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 common command dircolors in Linux

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

Share

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

This article mainly introduces the Linux commonly used command dircolors how to use, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

Linux commonly used command dircolors command is used to set the color used by the ls instruction to display directories or files. Dircolors can set the LS_COLORS environment variable or display the shell instruction that sets the LS_COLORS environment variable according to the [color profile].

Syntax dircolors [color profile] or

Dircolors [- bcp] [--help] [--version] parameter description:

-b or-sh or-bourne-shell is displayed in Boume shell, setting LS_COLORS to the currently preset shell instruction.

-c or-csh or-c-shell is displayed in C shell, setting LS_COLORS to the currently preset shell instruction.

-p or-print-database display preset

-help displays help.

-version displays version information.

Instance display default value

# dircolors-p / / displays the default value # Configuration file for dircolors, a utility to help you set the # LS_COLORS environment variable used by GNU ls with the-- color option. # Copyright (C) 1996, 1999-2008 # Free Software Foundation, Inc. # Copying and distribution of this file, with or without modification, # are permitted provided the copyright notice and this notice are preserved. # 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 Eterm TERM ansi TERM color-xterm TERM con132x25 TERM con132x30 TERM con132x43 TERM con132x60 TERM con80x25 TERM con80x28 TERM xterm-debian # 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 # no color code at all # FILE 00 # regular file: use no color at all RESET 0 # reset to "normal" color DIR 01 countries 34 # directory LINK 01 countries 36 # symbolic link. (If you set this to 'target' instead of a # numerical value, the color is as for the file pointed to.) HARDLINK 44 symlink to nonexistent file 37 # regular file with more than one link FIFO 40 SETGID 33 # socket DOOR 01 SETGID 35 # socket DOOR 01 symlink to nonexistent file, or non-stat'able file SETUID 37 file that is setuid 41 # file that is setuid (upright s) SETGID 30 mit43 # file that is setgid (Grous) CAPABILITY 30 umbrellas 41 # file with capability STICKY_OTHER_WRITABLE 3042 # dir that is sticky and other-writable (+ tphaw) OTHER_WRITABLE 34 42 # dir that is other-writable (otakw) and not sticky STICKY 37 that you would like ls 44 # dir with the sticky bit set (+ t) and not other-writable # This is for files with execute permission: EXEC 01 politics 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 01politics 32 # executables (bright green) # .exe 01politics 32 # .com 01politics 32 # .btm 01politics 32 # .bat 01 politics 32 # Or if you want to colorize scripts even if they do not have the # executable bit actually set. # .sh 01x 32 # .CSH 01x 32 # archives or compressed (bright red) .tar 01scape 31 .pcx 01x 35 .mov 01x 35 .mpg 01x 35 .m2v 01x 35 .mkv 01x 35 .mkv 01x 35 .mp4v 01x 35 .m4v 01x 35 .mp4v 01x 35 .mp4v 01x 35 .vob 01scape 35 .qt 01scape 35 .nuv 01scape 35 .wmv 01x 35 .AS01scape 35 .rmv01scape 35 .rmv01scape 35 .FLC 01035 .Avi 01x 35 .fli 01ET35 .FLV 01 35 .gl 01x 35 .dl 01x 35 .xcf 01x 35 .xwd 01x 35 # http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions .axv 01x 35 .anx 01ash 35 # OGV 01ten 35 .ogx 01ash 35 # audio formats .aac 00ter36 .au 00ter36 .flac 00ter36 .mid 0036 .midi 00scape 36. MKA 0036 .mp3 0036 transfer.mpc 0036 / 36 .ogg 00itor36 .ra 0036 / .wav 00 36 # http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions .axa 00x 36 .oga 0010 36 .spx 0010 36 .xspf 0010 36 Thank you for reading this article carefully. I hope the article "how to use Linux commands dircolors" shared by the editor will be helpful to you. At the same time, I also hope you will support us, pay attention to the industry information channel, and more related knowledge is waiting for you to learn!

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