LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-29-2012, 02:06 PM   #1
vaibhavs17
Member
 
Registered: Mar 2009
Posts: 49

Rep: Reputation: 1
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
 
Old 06-29-2012, 03:24 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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.

Last edited by Kustom42; 06-29-2012 at 03:27 PM.
 
Old 06-29-2012, 03:27 PM   #3
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
set operations for strings in unix aruna t Linux - Newbie 9 05-15-2011 01:33 PM
[SOLVED] bash question: searching for info and changing the color of keywords in the results chicone Programming 4 05-06-2011 09:38 AM
How to set background color of "ANY" terminal (in bash?) xmo Linux - Newbie 8 08-14-2008 06:37 AM
LXer: Using Strings To Safely Get Program Usage Information On Linux And Unix LXer Syndicated Linux News 0 07-01-2008 05:41 PM
Resource strings for Unix Sam Hobbs Programming 5 07-12-2002 11:09 AM


All times are GMT -5. The time now is 02:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration