Today, I just want to put basic information regarding Linux files and that is color coding of files when user runs ls command.
When you run ls command, you see executable files in different colors, image files in different colors and so does the directories. The color coding of different types of files is located in a configuration file /etc/DIR_COLORS for Linux. A side note: this is in my centOS server.
Colors on my CentOS server are as below
- Executable files: Green
- Directory: Blue
- Image files(jpg, gif, bmp, png, tif): Magenta
- Symbolic links: Cyan
- Pipe: Yellow
- Socket: Magenta
- Orphaned symbolic links: Blinking Bold white with red background
- Block device driver: Bold yellow foreground, with black background
- Missing links along with files they point to: Blinking Bold white with red background
- Archives or compressed files(like tar,gz,zip,rpm): Red
You can change them if you understand /etc/DIR_COLORS file. They are in the format of (file type attribute codes: text color codes:Background color codes)
File type attribute codes are as below:
Text color codes are as below:
And finally, background color codes are:
The example definition for DIR file type which is of Bold Blue color, look for the entry: DIR 01;34
If you change the file than you have to logout and log back in to see the change.