CentOS6修改ls命令颜色

2020-06-28  本文已影响0人  敬你是条好汉

上午装了centos6 minimal,ls列出来的目录颜色简直瞎眼。
虽然ssh方便,但是强迫症不能忍。
百度修改方法,找了个把小时,居然没一个能用的。
必应了一下,一下就有结果了,吐血(网页可能需要灰机)
https://www.howtogeek.com/307899/how-to-change-the-colors-of-directories-and-files-in-the-ls-command/

下面复制粘贴吧

直接命令看结果

LS_COLORS="di=1:31"

1是粗体,31是颜色

【引用】颜色定义
Black: 30
Blue: 34
Cyan: 36
Green: 32
Purple: 35
Red: 31
White: 37
Yellow: 33

【引用】标识定义
Directory: di
File: fi
Symbolic Link: ln
Named Pipe (FIFO): pi
Socket: so
Block Device: bd
Character Device: cd
Orphan Symbolic Link (points to a file that no longer exists): or
Missing File (a missing file that an orphan symbolic link points to): mi
Executable File (has the “x” permission): ex
*.extension: Any file ending with an extension you specify. For example, use *.txt for files ending in .txt, *.mp3 for files ending in .mp3, *.desktop for files ending in .desktop, or anything else you like. You can specify as many different file extensions as you like.

启动生效

加到~/.bashrc最后

export LS_COLORS=$LS_COLORS"di=1;31:"
上一篇下一篇

猜你喜欢

热点阅读