文章目录

绿色背景影响阅读

linux_bash/zsh ls(dircolor)_文件夹背景颜色去除(绿色背景)(fit to wsl)(simple solution)_去除背景

去除背景

通用配置

# remove the background color to improve the reading experience.
eval "$(dircolors -p | \
sed 's/ 4[0-9];/ 01;/; s/;4[0-9];/;01;/g; s/;4[0-9] /;01 /' | \
dircolors /dev/stdin)"

将其粘贴到​​~/.bashrc​​​或者​​~/.zshrc​​​中
(用哪个shell就粘贴到对应的配置文件中)
配置完毕后保存,用
​​​source ~/.bashrc​​​,
​​​source ~/.zshrc​​ 是配置生效


for bash only

  • 将linux的shell切换为bash(依次执行以下命令)
    如果是zsh(特别时使用了oh my zsh )会导致一些异常(比如重新进入的时候失效)
  • ​bash​
  • ​dircolors -p | sed 's/;42/;01/' > ~/.dircolors​
  • ​source ~/.bashrc​

效果

bash/zsh(oh my zsh)列出来的目录都不再有背景色
linux_bash/zsh ls(dircolor)_文件夹背景颜色去除(绿色背景)(fit to wsl)(simple solution)_去除背景_02