Task 3:How can we change colour of file and folder in linux
Vaishali Dewangan
Data Engineer at @Tredence Analytics | Certified Google Professional Data Engeneer | SQL | Python | Power BI
Tips: Before running any command to change the color of file/folder first save the original color in some variable
ORIGINAL_FILE_COLOR=$LS_COLORS
ORIGINAL_FOLDER_COLOR=$LS_COLORS
To change the color of file following command can be used
LS_COLORS="fi=var1:var2"
above var1 defines text properties and it can be
and var2 defines the colour of the text some color code are as follows
black = 30, red = 31, green = 32, yellow = 33, blue = 34, magenta = 35, cyan = 36, and white = 37.
Now to set the default file color :
LS_COLORS=$ORIGINAL_FILE_COLOR
To change the color of a directory or folder we simply have to put 'fi' instead of 'di' in the following command
LS_COLORS="fi=var1:var2"
I am happy to complete this task successfully thanks to LinuxWorld Informatics Pvt Ltd to give me this task.
AWS Cloud Engineer
1 年usefull