1. 终端输入


2. brew installxz coreutils

3. gdircolors --print-database > ~/.dir_colors

4. 在~/.bash_profile配置文件中加入以下代码:


 if brew list | grep coreutils > /dev/null ; then
    PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
    alias ls='ls --show-control-chars --color=auto'
    eval `gdircolors -b $HOME/.dir_colors`
  fi
 
 
5.   dircolor的作用就是设置ls命令使用的环境变量LS_COLORS(BSD是LSCOLORS),我们可以修改~/.dir_colors自定义文件的颜色,此文件中的注释已经包含各种颜色取值的说明。
 
 
mac终端配色
 

相关文章:

  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-09-02
  • 2021-05-08
  • 2021-12-27
  • 2021-12-03
猜你喜欢
  • 2022-01-10
  • 2021-05-18
  • 2022-12-23
  • 2021-07-16
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案