When I type "ls" in the linux terminal the folder names should appear in green color and file name in black color. How do I do this?
|
feedback
|
migrated from stackoverflow.com Feb 16 '11 at 8:46
This question came from our site for professional and enthusiast programmers.
|
These colors are defined in /etc/DIR_COLORS For instance, I have the following line:
Which means:
Attribute codes: Text color codes: Background color codes: So basically:
| |||
|
feedback
|
|
You can specify
should give you files in green and directories in grey (closest thing to black that's available). See this page on configuring LS_COLORS. | |||
|
feedback
|
then put the following lines LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=0 export LS_COLORS save the changes
and the changes should apply every-time you login to the linux box PS: you can adjust the color accordingly to your preference | |||
|
feedback
|
man lsshould give you the answer quicker than waiting here until someone will give you the copy-paste solution. Is this the mindset? – Andrejs Cainikovs Feb 16 '11 at 8:52