Use the ls command in Ubuntu to display and modify the file color.

Source: Internet
Author: User
Tags bit set bmp image
In Ubuntu, when you use the ls command to display files and folders in the directory, different colors are displayed first, as shown in. If you know the meanings of different colors, therefore, it is much easier to view the file information in the directory, So we searched for the relevant article and found an article, as shown below: # Attributecodes: character attribute #00 = none01 = bold04 = underscore05 = blink07 = reverse08 = concealed #00

In Ubuntu, when you use the ls command to display files and folders in the directory, different colors are displayed first, as shown in:

If we know the meanings of different colors, it is much easier for us to view the file information in the directory. So we searched for the relevant article and found an article, as shown below:

# Attribute codes: character Attribute
#00 = none 01 = bold 04 = underscore 05 = blink 07 = reverse 08 = concealed
#00 no 01 bold 04 underline 05 flashing 07 reverse 08 hide
# Text color codes: Character color
#30 = black 31 = red 32 = green 33 = yellow 34 = blue 35 = magenta 36 = cyan 37 = white
#30 Black 31 red 32 green 33 yellow 34 blue 35 pink 36 light blue 37 white
# Background color codes: character Background color
#40 = black 41 = red 42 = green 43 = yellow 44 = blue 45 = magenta 46 = cyan 47 = white
#40 black 41 Red 42 green 43 Yellow 44 Blue 45 pink 46 light blue 47 white
NORMAL 00 # global default, although everything shoshould be something. default color of common file Terminal
FILE 00 # normal file normal FILE terminal default color
DIR 01; 34 # directory bold-blue
LINK 01; 36 # symbolic link. (If you set this to 'target' instead of a, the LINK is in bold-pale blue.
# Numerical value, the color is as for the file pointed .)
FIFO 40; 33 # Black Bottom of pipe pipeline API-yellow
SOCK 01; 35 # socket API bold-pink
DOOR 01; 35 # door API bold-pink
BLK 40; 33; 01 # block device driver bold-Black Bottom-yellow
CHR 40; 33; 01 # character device driver bold-Black Bottom-yellow
ORPHAN 40; 31; 01 # symlink to nonexistent file points to a symbolic link that does not exist in the file in bold-black-red letter
SETUID 37; 41 # file that is setuid (u + s) specifies the red background of the UID file-white text
SETGID 30; 43 # file that is setgid (g + s) specifies the bottom of the GID file-black
STICKY_OTHER_WRITABLE 30; 42 # dir that is sticky and other-writable (+ t, o + w) + t, o + w permissions for the green background-black words (not commonly used)
OTHER_WRITABLE 34; 42 # dir that is other-writable (o + w) and not sticky-t, o + w permissions for files green-blue words (not commonly used)
STICKY 37; 44 # dir with the sticky bit set (+ t) and not other-writable + t, o-w permission on the blue background-white words (not commonly used)
# This is for files with execute permission:
EXEC 01; 32 bold-green
# List any file extensions like '.gz 'or '.tar' that you wowould like ls
# To colorize below. Put the extension, a space, and the color init string.
# (And any comments you want to add after '#')
# If you use DOS-style suffixes, you may want to uncomment the following:
#. Cmd 01; 32 # executables (bright green). cmd Executable File bold-green (bright)
Cmd.exe 01; 32. exe file bold-green
#. Com 01; 32. com file bold-green
#. Btm 01; 32. btm file bold-green
#. Bat 01; 32. bat file bold-green
. Tar 01; 31 # archives or compressed (bright red). tar compressed file bold-red letter (bright)
. Tgz 01; 31. tgz file bold-red letter
. Arj 01; 31. arj file bold-red letter
. Taz 01; 31. taz file bold-red letter
. Lzh 01; 31. The lzh file is in bold-red letter
. Zip 01; 31. zip file bold-red letter
. Z 01; 31. z file bold-red letter
. Z 01; 31. Z file bold-red letter
. Gz 01; 31. gz file bold-red letter
. Bz2 01; 31. bz2 file bold-red letter
. Deb 01; 31. deb file bold-red letter
. Rpm 01; 31. rpm file bold-red letter
. Jar 01; 31. jar file bold-red letter
# Image formats
. Jpg 01; 35. jpg bold-pink
. Jpeg 01; 35. jpeg image bold-pink
. Gif 01; 35. gif image bold-pink
. Bmp 01; 35. bmp image bold-pink
. Pbm 01; 35. pbm image bold-pink
. Pgm 01; 35. pgm image bold-pink
. Ppm 01; 35. ppm image bold-pink
. Tga 01; 35. tga image bold-pink
. Xbm 01; 35. xbm image bold-pink
. Xpm 01; 35. xpm image bold-pink
. Tif 01; 35. tif: bold-pink
. Tiff 01; 35. tiff image bold-pink
. Png 01; 35. png bold-pink
. Mov 01; 35. mov video bold-pink
. Mpg 01; 35. mpg video bold-pink
. Mpeg 01; 35. mpeg Video bold-pink
. Avi 01; 35. avi Video bold-pink
. Fli 01; 35. fli video bold-pink
. Gl 01; 35. gl video bold-pink
. Dl 01; 35. dl video bold-pink
. Xcf 01; 35. xcf video bold-pink
. Xwd 01; 35. xwd video bold-pink
# Audio formats
. Flac 01; 35. flac audio bold-pink
. Mp3 01; 35. mp3 audio bold-pink
. Nm01; 35. MMP audio bold-pink
. Ogg 01; 35. ogg audio bold-pink
. Wav 01; 35. wav audio bold-pink

PS: The color of the file executable permission is displayed first than the File ACL.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.