教你如何改变 Mac 终端背景与命令的颜色

Mac 终端不仅可以使用黑白颜色,我们还可以自定义它的命令与背景的颜色,帮助识别不同种类的命令,下面是一些小方法,大家可以尝试下。

打开终端输入并且键入:

nano .bash_profile

再次键入:

黑色背景用以下命令
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
白色背景用以下命令
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

Control+O然后回车。

改变背景颜色可以进入终端菜单(终端窗口处于焦点状态时,看顶部状态栏菜单)的偏好设置。

自定义终端命令颜色

"exfxcxdxbxegedabagacad"是终端默认的,下面给出的各个字母代表指代的不同颜色:

a black
b red
c green
d brown
e blue
f magenta
g cyan
h light grey
A bold black, usually shows up as dark grey
B bold red
C bold green
D bold brown, usually shows up as yellow
E bold blue
F bold magenta
G bold cyan
H bold light grey; looks like bright white
x default foreground or background


LSCOLOR上方各个字母的次序指代的不同命令:

1. directory
2. symbolic link
3. socket
4. pipe
5. executable
6. block special
7. character special
8. executable with setuid bit set
9. executable with setgid bit set
10. directory writable to others, with sticky bit
11. directory writable to others, without sticky


你可能感兴趣的:(mac,颜色,终端)