Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Linux dircolors command

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to use the Linux dircolors command". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use the Linux dircolors command" can help you solve the problem.

The dircolors command sets the color that the ls command uses when displaying directories or files. Dircolors can set the LS_COLORS environment variable or display the command to set the LS_COLORS environment variable according to the color profile.

Dircolors sets the color used by the ls command to display directories or files

Syntax dircolors (option) (parameter) option-b or-- sh or-- bourne-shell: display in Boume shell, set LS_COLORS to the current preset shell instruction;-c or-- csh or-- c-shell: display in C shell, set LS_COLORS to the current preset shell instruction;-p or-- print-database: display preset;-help: display help;-version: display version information. Parameter file: specifies the file used to set the color.

Example [root@localhost ~] # dircolors-p # Configuration file for dircolors, a utility to help you set the # LS_COLORS environment variable used by GNU ls with the-- color option. # The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the # slackware version of dircolors) are recognized but ignored. # Below, there should be one TERM entry for each termtype that is colorizable TERM linux TERM linux-c TERM mach-color TERM console TERM con132x25 TERM con132x30 TERM con132x43 TERM con132x60 TERM con80x25 TERM con80x28 TERM con80x30 TERM con80x43 TERM con80x50 TERM con80x60 TERM cygwin TERM dtterm TERM putty TERM xterm TERM xterm-color TERM xterm-debian TERM rxvt TERM screen TERM screen-bce TERM screen-w TERM vt100 TERM Eterm # Below are the color init strings for the basic file types. A color init # string consists of one or more of the following numeric codes: # Attribute codes: # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed # Text color codes: # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white # Background color codes: # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white NORMAL 00 # global default, although everything should be something. FILE 00 # normal file DIR 01: 34 # directory LINK 01: 36 # symbolic link. (If you set this to 'target' instead of a # numerical value, the color is as for the file pointed to.) FIFO 40: 33 # pipe SOCK 01: 35 # socket DOOR 01: 35 # door BLK 40: 33: 01 # block device driver CHR 40: 33 # character device driver ORPHAN 40: 31: 01 # symlink to nonexistent file SETUID 37: 41 # file that is setuid (uplifts) SETGID 30: 43 # file that is setgid (Globs) STICKY_OTHER_WRITABLE 30: 42 # dir that is sticky and other-writable (+ tMaguo: obliterw) OTHER_WRITABLE 34: 41 # dir that is other-writable (osigw) and not sticky STICKY 37 44 # dir with the sticky bit set (+ t) and not other-writable # This is for files with execute permission: exec 01 Taiwan 32 # List any file extensions like '.gz' or '.tar' that you would like ls # to colorize below. Put the extension, a space, and the color init string. # (and any comments you want to add after a'#') # If you use DOS-style suffixes, you may want to uncomment the following: # .cmd 01x 32 # executables (bright green) # .exe 01x 32 # .com 01x 32 # .btm 01x 32 # .bat 01ten 32 .tar 01ten 31 # archives or compressed (bright red) .tgz 01ten 31 .arj 01tern .taz 01ter31 .lzh 01ten 31 .zip 01x 31 .z 01x 31 .Z 01ten 31 .gz 01x 31 .bz2 01 31 .deb 01x 31 .rpm 01x 31 .jar 01x 31 # image formats .jpg 01x 35 .gif 01x 35 .bmp 01x 35 .pbm 01x 35 .pgm 01x 35 .ppm 01x 35 .tga 01x 35 .xbm 01x 35 .xpm 01x 35 .tif 01x 35 .tiff 01x 35 .png 01x 35 .mov 01x 35 .mpg 01x 35 .mpeg 01x 35 .avi 01x 35 .fli 01x 35 .gl 01x 35 .xcf 01x .xwd 01 35 # audio formats .flac 01x 35 .mp301x 35 .mpc 01x 35 .ogg 01x 35 .wav 01x 35 this is the end of the introduction of "how to use Linux dircolors commands". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report