这篇文章主要介绍了Linux常用命令dircolors怎么用,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

Linux常用命令dircolors命令用于设置 ls 指令在显示目录或文件时所用的色彩,dircolors可根据[色彩配置文件]来设置LS_COLORS环境变量或是显示设置LS_COLORS环境变量的shell指令。

语法

dircolors[色彩配置文件]

dircolors[-bcp][--help][--version]

参数说明:

-b或–sh或–bourne-shell  显示在Boume shell中,将LS_COLORS设为目前预设置的shell指令。

-c或–csh或–c-shell  显示在C shell中,将LS_COLORS设为目前预设置的shell指令。

-p或–print-database  显示预设置

-help  显示帮助。

-version  显示版本信息。

实例

显示默认值

#dircolors-p//显示默认值#Configurationfilefordircolors,autilitytohelpyousetthe#LS_COLORSenvironmentvariableusedbyGNUlswiththe--coloroption.#Copyright(C)1996,1999-2008#FreeSoftwareFoundation,Inc.#Copyinganddistributionofthisfile,withorwithoutmodification,#arepermittedprovidedthecopyrightnoticeandthisnoticearepreserved.#ThekeywordsCOLOR,OPTIONS,andEIGHTBIT(honoredbythe#slackwareversionofdircolors)arerecognizedbutignored.#Below,thereshouldbeoneTERMentryforeachtermtypethatiscolorizableTERMEtermTERMansiTERMcolor-xtermTERMcon132x25TERMcon132x30TERMcon132x43TERMcon132x60TERMcon80x25TERMcon80x28TERMxterm-debian#Belowarethecolorinitstringsforthebasicfiletypes.Acolorinit#stringconsistsofoneormoreofthefollowingnumericcodes:#Attributecodes:#00=none01=bold04=underscore05=blink07=reverse08=concealed#Textcolorcodes:#30=black31=red32=green33=yellow34=blue35=magenta36=cyan37=white#Backgroundcolorcodes:#40=black41=red42=green43=yellow44=blue45=magenta46=cyan47=white#NORMAL00#nocolorcodeatall#FILE00#regularfile:usenocoloratallRESET0#resetto“normal“colorDIR01;34#directoryLINK01;36#symboliclink.(Ifyousetthisto'target'insteadofa#numericalvalue,thecolorisasforthefilepointedto.)HARDLINK44;37#regularfilewithmorethanonelinkFIFO40;33#pipeSOCK01;35#socketDOOR01;35#doorBLK40;33;01#blockdevicedriverCHR40;33;01#characterdevicedriverORPHAN40;31;01#symlinktononexistentfile,ornon-stat'ablefileSETUID37;41#filethatissetuid(u+s)SETGID30;43#filethatissetgid(g+s)CAPABILITY30;41#filewithcapabilitySTICKY_OTHER_WRITABLE30;42#dirthatisstickyandother-writable(+t,o+w)OTHER_WRITABLE34;42#dirthatisother-writable(o+w)andnotstickySTICKY37;44#dirwiththestickybitset(+t)andnotother-writable#Thisisforfileswithexecutepermission:EXEC01;32#Listanyfileextensionslike'.gz'or'.tar'thatyouwouldlikels#tocolorizebelow.Puttheextension,aspace,andthecolorinitstring.#(andanycommentsyouwanttoaddaftera'#')#IfyouuseDOS-stylesuffixes,youmaywanttouncommentthefollowing:#.cmd01;32#executables(brightgreen)#.exe01;32#.com01;32#.btm01;32#.bat01;32#Orifyouwanttocolorizescriptseveniftheydonothavethe#executablebitactuallyset.#.sh01;32#.csh01;32#archivesorcompressed(brightred).tar01;31.pcx01;35.mov01;35.mpg01;35.mpeg01;35.m2v01;35.mkv01;35.ogm01;35.mp401;35.m4v01;35.mp4v01;35.vob01;35.qt01;35.nuv01;35.wmv01;35.asf01;35.rm01;35.rmvb01;35.flc01;35.avi01;35.fli01;35.flv01;35.gl01;35.dl01;35.xcf01;35.xwd01;35.yuv01;35#http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions.axv01;35.anx01;35.ogv01;35.ogx01;35#audioformats.aac00;36.au00;36.flac00;36.mid00;36.midi00;36.mka00;36.mp300;36.mpc00;36.ogg00;36.ra00;36.wav00;36#http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions.axa00;36.oga00;36.spx00;36.xspf00;36

感谢你能够认真阅读完这篇文章,希望小编分享的“Linux常用命令dircolors怎么用”这篇文章对大家有帮助,同时也希望大家多多支持亿速云,关注亿速云行业资讯频道,更多相关知识等着你来学习!