LinuxQuestions.org
Help answer threads with 0 replies.
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 11-26-2010, 06:05 AM   #1
noony123
Member
 
Registered: Oct 2010
Posts: 167

Rep: Reputation: 0
LS color in RHEL5


Hi all.

I am using RHEL 5. I wanted to know that if i edit /etc/DIR_COLOR to change the color of files while displaying through ls command, do i need to logout to take it effect or is there any other way ?

i performed the following steps

1) edited the /etc/DIR_COLOR file (using nano)
[root@WAN-Admin ~]# cat /etc/DIR_COLORS | grep -i file
# Configuration file for the color ls utility
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# Below are the color init strings for the basic file types. A color init
FILE 32 # normal file
MISSING 01;05;37;41 # ... and the files they point to
# This is for files with execute permission:
# List any file extensions like '.gz' or '.tar' that you would like

2) run the following command

[root@WAN-Admin ~]# eval 'dircolors /etc/DIR_COLORS'
LS_COLORS='no=00:fi=32:di=01;34:ln=01;36i=40;33:so=01;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi=01;05;37;41:ex=01;32: *.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz =01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*. bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=0 1;35:*.png=01;35:*.tif=01;35:';
export LS_COLORS

Now when i issue ls command, i am still seeing file with white color. if i logout and then login, the file color successfully changes. So can anyone advice, how to do this without logging out ?

thanks in advance
 
Old 11-26-2010, 07:34 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,

Try: eval $(dircolors -b /etc/DIR_COLORS)

Hope this helps.
 
Old 11-27-2010, 03:20 AM   #3
noony123
Member
 
Registered: Oct 2010
Posts: 167

Original Poster
Rep: Reputation: 0
Thanks alot, It really worked :-)
 
Old 11-27-2010, 03:45 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
You're welcome
 
  


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
RHEL5 gvim keyword color coding fallen angel Red Hat 3 03-20-2010 10:05 AM
How to change font color and size in RHEL5? saagar Linux - Newbie 2 06-01-2009 09:11 PM
Color registration bars on output: Lexmark C510 Color Laser printer spud_linux Linux - Hardware 2 10-06-2008 12:46 PM
[COLOR=red]ENCORE WIRELESS PCI Card 802.11b [/COLOR] enrique145 Linux - Hardware 3 07-07-2004 02:31 PM


All times are GMT -5. The time now is 06:56 PM.

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