CentOS6修改ls命令颜色

上午装了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:"
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容