Mac terminal 终端颜色区分显示

Terminal 默认是没有颜色区分的,打开也好整,只需要设置一下

参阅:https://stackoverflow.com/questions/1550288/os-x-terminal-colors

Mac terminal 终端颜色区分显示_第1张图片


方法

编辑自己用户目录下的 .bash_profile 文件,如果没有,新建一个就好

export CLICOLOR=1 # 打开颜色区分显示
export LSCOLORS=Gxfxcxdxbxegedabagacad  # 颜色显示的格式

关于颜色,可以自定义,通过这个网站可以快速编辑颜色方案

https://geoff.greer.fm/lscolors/

编辑完这个文件后执行下面指令使其生效

source .bash_profile

然后打开 Terminal 的设置窗口Preferences > Profiles > Display ANSI Colors (我用的英文,如果你是中文,看图)


效果

Mac terminal 终端颜色区分显示_第2张图片

你可能感兴趣的:(运维,Mac)