linux修改ls文件颜色
来源:互联网 发布:网吧电影网站源码 编辑:程序博客网 时间:2024/04/29 13:54
ls指令显示的文件,可以通过设置环境变量LS_COLORS,修改不同类型文件显示的颜色。LS_COLORS可以通过指定文件设定,如:
shell terminal$dircolors -b .mydircolor
若未指定,则读取默认的值,可以通过如下指令查看。
shell terminal$dircolors -p更多信息请通过 man dircolors(1)查看。
自己定制ls输出的文件颜色时,可以通过多个方法定制:
在.bashrc、/etc/profile等初始化的文件中定义LS_COLORS:(e.g.)LS_COLORS="ow=01;90:di=01;90"export LS_COLORS2.
获取默认值写入一文件(.mydircolor)shell terminal$dircolors -p > ~/.mydircolor按照自己喜好修改文件~/.mydircolor在.bashrc等初始化文件中加入语句:test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)"
LS_COLORS值是key-value的字符串,key可取的值见下表:
noNORMAL, NORMGlobal default, although everything should be somethingfiFILENormal filediDIRDirectorylnSYMLINK, LINK, LNKSymbolic link. If you set this to ‘target’ instead of a numerical value, the color is as for the file pointed to.piFIFO, PIPENamed pipedoDOORDoorbdBLOCK, BLKBlock devicecdCHAR, CHRCharacter deviceorORPHANSymbolic link pointing to a non-existent filesoSOCKSocketsuSETUIDFile that is setuid (u+s)sgSETGIDFile that is setgid (g+s)twSTICKY_OTHER_WRITABLEDirectory that is sticky and other-writable (+t,o+w)owOTHER_WRITABLEDirectory that is other-writable (o+w) and not stickystSTICKYDirectory with the sticky bit set (+t) and not other-writableexEXECExecutable file (i.e. has ‘x’ set in permissions)miMISSINGNon-existent file pointed to by a symbolic link (visible when you type ls -l)lcLEFTCODE, LEFTOpening terminal codercRIGHTCODE, RIGHTClosing terminal codeecENDCODE, ENDNon-filename text*.extension Every file using this extension e.g. *.jpg
每个key对应的value,确定该类文件的颜色,value可以由多个值以“;"分割开(字体颜色、背景颜色),各个key之间以":"分割开。value的可取值如下表:
Effects00Default colour01Bold04Underlined05Flashing text07Reversetd08ConcealedColours31Red32Green33Orange34Blue35Purple36Cyan37GreyBackgrounds40Black background41Red background42Green background43Orange background44Blue background45Purple background46Cyan background47Grey backgroundExtra colours90Dark grey91Light red92Light green93Yellow94Light blue95Light purple96Turquoise97White100Dark grey background101Light red background102Light green background103Yellow background104Light blue background105Light purple background106Turquoise background
更多信息,参考:
http://www.bigsoft.co.uk/blog/index.php/2008/04/11/configuring-ls_colors
http://ubuntuforums.org/showthread.php?t=1297960
- linux修改ls文件颜色
- 如何修改linux中console下ls显示各种文件的颜色和vim中颜色
- linux ls文件颜色和底色设置
- ubuntu 修改ls颜色
- ubuntu修改ls颜色
- ubuntu 终端修改ls文件的字体颜色
- Linux ls 颜色设置
- Linux ls 文件名颜色
- Linux基础:文件颜色,ls,ll,文件详情解析
- linux终端下,使用ls时,显示的文件颜色,都表示什么含义,在哪里可以查看和修改
- linux终端下,使用ls时,显示的文件颜色,都表示什么含义,在哪里可以查看和修改
- 修改ls目录的颜色
- ubuntu14 修改ls文件夹颜色
- ls命令输出颜色修改
- 修改ls目录的颜色
- linux 下设置 ls 命令 显示 文件、文件夹颜色
- [linux_shell]linux下设置ls命令显示文件、文件夹颜色
- Linux下ls显示文件颜色的含义
- cocos2d游戏开发,常用工具集合
- Mysql导入大容量SQL文件数据问题
- 修改ssh登录目录
- 本月目标
- 如何防止struts配置文件的膨胀
- linux修改ls文件颜色
- 导航栏
- 理解C#值类型和引用类型
- vs2010静态编译cjson2.1
- NetworkX:shapefile数据转换成图数据结构
- 禁忌搜索算法简介
- 一段评价程序平均运行时间的shell脚本&shell脚本编写注意事项
- 学习GNU Emacs命令速查表(四)
- 觉得做人累了就看看这些!不是社会错了,是你错了... - Qzone日志