Mac 终端不仅可以使用黑白颜色,我们还可以自定义它的命令与背景的颜色,帮助识别不同种类的命令,下面是一些小方法,大家可以尝试下。
打开终端输入并且键入:
nano .bash_profile
再次键入:
黑色背景用以下命令export CLICOLOR=1export LSCOLORS=GxFxCxDxBxegedabagaced
白色背景用以下命令export CLICOLOR=1export LSCOLORS=ExFxBxDxCxegedabagacad
Control+O然后回车。
改变背景颜色可以进入终端菜单(终端窗口处于焦点状态时,看顶部状态栏菜单)的偏好设置。
自定义终端命令颜色"exfxcxdxbxegedabagacad"是终端默认的,下面给出的各个字母代表指代的不同颜色:a blackb redc greend browne bluef magentag cyanh light greyA bold black, usually shows up as dark greyB bold redC bold greenD bold brown, usually shows up as yellowE bold blueF bold magentaG bold cyanH bold light grey; looks like bright whitex default foreground or background
LSCOLOR上方各个字母的次序指代的不同命令:
1. directory2. symbolic link3. socket4. pipe5. executable6. block special7. character special8. executable with setuid bit set9. executable with setgid bit set10. directory writable to others, with sticky bit11. directory writable to others, without sticky