使用 sudo 以 root 身份登录时显示奇怪的提示

使用 sudo 以 root 身份登录时显示奇怪的提示

当我以 root 身份登录时,

luvpreet@DHARI-Inspiron-3542:/$ sudo su

我得到了这样的信息:

\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ 

这是什么意思?为什么我会看到它?

编辑-这里有一些在评论中要求的更有用的内容,

luvpreet@DHARI-Inspiron-3542:/$ sudo su -
DHARI-Inspiron-3542#  
DHARI-Inspiron-3542# exit
luvpreet@DHARI-Inspiron-3542:/$ sudo -i
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ 
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ exit
luvpreet@DHARI-Inspiron-3542:/$ echo $0
/bin/bash

编辑 2 - 提及所发表的评论

luvpreet@DHARI-Inspiron-3542:/$ ls -1 /root/.[a-zA-Z0-9]*
ls: cannot access '/root/.*': Permission denied
luvpreet@DHARI-Inspiron-3542:/$ sudo su -
DHARI-Inspiron-3542# ls -1d /root/.[a-zA-Z0-9]*
/root/.bash_history
/root/.bashrc
/root/.bashrc.bk
/root/.profile
/root/.profile.bk
/root/.viminfo
/root/.zcompdump

编辑3-

luvpreet@DHARI-Inspiron-3542:/etc/ansible$ sudo find /root /etc/ -maxdepth 1 -type f -exec grep -n PS1 {} +
/root/.zcompdump:1201:'-value-,PS1,-default-' '_ps1234'
/root/.zcompdump:1207:'-value-,RPS1,-default-' '_ps1234'
/root/.bashrc:60:    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
/root/.bashrc:62:    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
/root/.bashrc:69:    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
/root/.bashrc.bk:9:[ -z "$PS1" ] && return
/root/.bashrc.bk:56:    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
/root/.bashrc.bk:58:    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
/root/.bashrc.bk:65:    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
/etc/profile:7:if [ "$PS1" ]; then
/etc/profile:9:    # The file bash.bashrc already sets the default PS1.
/etc/profile:10:    # PS1='\h:\w\$ '
/etc/profile:16:      PS1='# '
/etc/profile:18:      PS1='$ '
/etc/bash.bashrc:7:[ -z "$PS1" ] && return
/etc/bash.bashrc:19:PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

相关内容