LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to set color for preserved keywords, strings in unix terminal? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-color-for-preserved-keywords-strings-in-unix-terminal-4175414043/)

vaibhavs17 06-29-2012 01:06 PM

how to set color for preserved keywords, strings in unix terminal?
 
Hi Friends,


I am new to linux terminal , could you please assist me how to set terminal colors for preserved keywords, string, variables?

Thanks,
Vaibhav

Kustom42 06-29-2012 02:24 PM

Bash does have a built in "dircolors" functionality and some google searching on bash dircolors should give you some insight onto this as its a lot of info and kind of outside of what can be put into a single post.

Someone else may know of a better way to make certain strings show up as certain colors but I have never attempted or seen it in action.

Kustom42 06-29-2012 02:27 PM

This is a good explanation of dircolors and how you can specify specific colors for directory listings:

http://systhread.net/texts/200703bashish.php/

I believe you can add these colors to other commands such as grep by aliasing grep to "grep --color" in your .bashrc or .bash_profile file.


All times are GMT -5. The time now is 12:08 AM.