Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的~/.bashrc我有
~/.bashrc
export PS1="\[\033[0;39m\]\u@\h:\[\033[0;32m\]\w\$\[\033[00m\] "
它将当前工作目录的路径颜色更改为绿色。是否可以使用 bashrc 为每个路径级别着色不同的颜色?例如,如果我导航到
cd /usr/share/color me@server4:/usr/share/color$
我想要/usr红色,/share绿色,/color蓝色等。
/usr
/share
/color
每次显示提示时都可以在提示中运行外部命令,一切皆有可能。