擅长:python、mysql、java
<p>在Debian Stretch下,<code>PS1</code>设置在<code>/etc/bash.bashrc</code>:</p>
<pre><code># set a fancy prompt (non-color, overwrite the one in /etc/profile)
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
</code></pre>
<p>这也是来源于<code>/etc/profile</code>:</p>
<pre><code>if [ "${PS1-}" ]; then
if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
# The file bash.bashrc already sets the default PS1.
# PS1='\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
</code></pre>