7
误删/home文件夹,导致Ubuntu命令行没有颜色怎么办?怎样把终端控制台的命令行颜色调...
source link: https://blog.popkx.com/how-to-set-teminal-color-of-Ubuntu/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
误删/home文件夹,导致Ubuntu命令行没有颜色怎么办?怎样把终端控制台的命令行颜色调出?
因为误删了 /home/user 目录下的文件,导致 Ubuntu 终端命令行的颜色都没了,如下图:
虽然可以指定alas ls='ls --color=auto'
(放入~/.bashrc
)让 ls 命令输出的文件带上颜色,但是命令行本身却依然没有颜色:
此时可以在~/.bashrc
中添加或者修改(请注意 PS1 关键字)如下内容:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
之后保存执行
$ source ~/.bashrc
即可获得彩色的终端:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK