Linux use ls to view the file color is all white solution, and Linux file color introduction

1. The color of the file is white

method 1 :

1. Modify the ~ /. Bashrc file and add the following

alias ls='ls --color=auto'

2. Source to make the configuration changes take effect

source ~/.bashrc

method 2 :

1. Directly under the command line, give LS -- color = auto an alias LS

alias ls='ls --color=auto'

be careful:

In this way, every time you open a new terminal, you have to execute it again. It’s better to configure it in the ~ /. Bashrc file!

2 introduction of file color in Linux

1. Ls has more than three output colors, including the following,

White : denotes common file Blue : denotes directory Green : denotes executable file Red : denotes compressed file light blue : linked file red flashing : denotes a problem with the linked file yellow : denotes e> Device files gray : indicates other files

2. This is the default color agreed by Linux system. You can also modify it according to your own preference. In the environment variable $ls_ Just modify it on colors , and change it in ~ /. Bashrc
if you want to save it permanently


Among them, before the semicolon is the background color of words , after the semicolon is the color of words

3 change the color of the user name

reference resources:

Read More: