Today, I have never mentioned "ls command color".

Source: Internet
Author: User
Today I have never mentioned "ls command color"-Linux general technology-Linux programming and kernel information. The following is a detailed description. In Linux, "Everything is a file", so many different types of files appear. For example, common files, symbolic link files, directory files, interface files, pipeline files, blocks, and character device files.

Because of the functions of the ls command, different colors are displayed when you use the ls command to view these files.

How can we modify these colors? Edit the/etc/DIR_COLORS file.

After opening the file with vim, You can see detailed instructions. One thing to note is that if you copy and rename the file and save it in $ HOME (your HOME), you can generate a user-independent configuration, this configuration prevails over the system configuration.

The method is cp/etc/DIR_COLORS ~ /. Dir_colors

The first option in this file is: COLOR?

Here? There are three options:

1. Enter tty. Then, the color is only displayed in the ls command.

2. Enter all. This will display the color at all output locations, even in the pipeline.

3. none. If you do not want to talk about it, go to the dictionary.

Note: If you select all, the color is not necessarily displayed. You may only see the characters transmitted by the ls as the contact.

Therefore, the default setting is better. (Let me skip this section)

Find the next section
NORMAL XX
FILE XX
Dir xx; XX

There is also a long format similar to this. The front is the file type, followed by the file color code.

For example, 40 = black 41 = red.

If you are not satisfied with the default color of the file, you can change the color by modifying this code.

For example, I hate the blue color of directory files, so I usually change the number after DIR to: 01: 33. Do not change it to BLACK, it's ugly. (Author: Frost cold not tried)
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.