dircolors

置ls命令在顯示目錄或文件時所用的色彩

補充說明

dircolors命令 設置ls命令在顯示目錄或文件時所用的色彩。dircolors可根據[色彩配置文件]來設置LS_COLORS環境變量或是顯示設置LS_COLORS環境變量的命令。

語法

1dircolors(選項)(參數)

選項

1-b或--sh或--bourne-shell:顯示在Boume shell中,將LS_COLORS設爲目前預設置的shell指令;
2-c或--csh或--c-shell:顯示在C shell中,將LS_COLORS設爲目前預設置的shell指令;
3-p或--print-database:顯示預設置;
4-help:顯示幫助;
5-version:顯示版本信息。

參數

文件:指定用來設置顏色的文件。

實例

  1[root@localhost ~]# dircolors -p
  2# Configuration file for dircolors, a utility to help you set the
  3# LS_COLORS environment variable used by GNU ls with the --color option.
  4# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
  5# slackware version of dircolors) are recognized but ignored.
  6# Below, there should be one TERM entry for each termtype that is colorizable
  7TERM linux
  8TERM linux-c
  9TERM mach-color
 10TERM console
 11TERM con132x25
 12TERM con132x30
 13TERM con132x43
 14TERM con132x60
 15TERM con80x25
 16TERM con80x28
 17TERM con80x30
 18TERM con80x43
 19TERM con80x50
 20TERM con80x60
 21TERM cygwin
 22TERM dtterm
 23TERM putty
 24TERM xterm
 25TERM xterm-color
 26TERM xterm-debian
 27TERM rxvt
 28TERM screen
 29TERM screen-bce
 30TERM screen-w
 31TERM vt100
 32TERM Eterm
 33# Below are the color init strings for the basic file types. A color init
 34# string consists of one or more of the following numeric codes:
 35# Attribute codes:
 36# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
 37# Text color codes:
 38# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
 39# Background color codes:
 40# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
 41NORMAL 00 # global default, although everything should be something.
 42FILE 00 # normal file
 43DIR 01;34 # directory
 44LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
 45 # numerical value, the color is as for the file pointed to.)
 46FIFO 40;33 # pipe
 47SOCK 01;35 # socket
 48DOOR 01;35 # door
 49BLK 40;33;01 # block device driver
 50CHR 40;33;01 # character device driver
 51ORPHAN 40;31;01 # symlink to nonexistent file
 52SETUID 37;41 # file that is setuid (u+s)
 53SETGID 30;43 # file that is setgid (g+s)
 54STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
 55OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
 56STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
 57# This is for files with execute permission:
 58exec 01;32
 59# List any file extensions like '.gz' or '.tar' that you would like ls
 60# to colorize below. Put the extension, a space, and the color init string.
 61# (and any comments you want to add after a '#')
 62# If you use DOS-style suffixes, you may want to uncomment the following:
 63#.cmd 01;32 # executables (bright green)
 64#.exe 01;32
 65#.com 01;32
 66#.btm 01;32
 67#.bat 01;32
 68.tar 01;31 # archives or compressed (bright red)
 69.tgz 01;31
 70.arj 01;31
 71.taz 01;31
 72.lzh 01;31
 73.zip 01;31
 74.z 01;31
 75.Z 01;31
 76.gz 01;31
 77.bz2 01;31
 78.deb 01;31
 79.rpm 01;31
 80.jar 01;31
 81# image formats
 82.jpg 01;35
 83.jpeg 01;35
 84.gif 01;35
 85.bmp 01;35
 86.pbm 01;35
 87.pgm 01;35
 88.ppm 01;35
 89.tga 01;35
 90.xbm 01;35
 91.xpm 01;35
 92.tif 01;35
 93.tiff 01;35
 94.png 01;35
 95.mov 01;35
 96.mpg 01;35
 97.mpeg 01;35
 98.avi 01;35
 99.fli 01;35
100.gl 01;35
101.dl 01;35
102.xcf 01;35
103.xwd 01;35
104# audio formats
105.flac 01;35
106.mp3 01;35
107.mpc 01;35
108.ogg 01;35
109.wav 01;35

來源:https://github.com/jaywcjlove/linux-command

最後修改於: Wednesday, January 31, 2024

相關文章:

翻譯: