LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-06-2003, 10:01 PM   #1
l0f33t
Member
 
Registered: May 2003
Location: Washington State
Distribution: Gentoo
Posts: 145

Rep: Reputation: 15
Shell and file/directory color coding?


Hello,
Im trying to figure out where in linux either a man page or where I can configure or figure out the color coding map scheme used for files, directories, exe's ect...when inside a shell terminal and issue a ls -la command..

I thought that it was explained somewhere I just don't remember.

Thanks,
 
Old 08-06-2003, 10:04 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
/etc/DIR_COLORS

man dircolors

 
Old 08-06-2003, 10:23 PM   #3
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Rep: Reputation: 31
in .bashrc you can add:
Code:
alias "ls=ls --color"
that should do the trick and you never have to worry about DIR_COLORS and whatnot (not that it's hard).

only thing is you cant pipe the result of ls into less
 
Old 08-06-2003, 10:56 PM   #4
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Actually, you can.

ls --color | less -r

(Might need -R if that goes goofy on ya.)
 
Old 08-06-2003, 11:32 PM   #5
l0f33t
Member
 
Registered: May 2003
Location: Washington State
Distribution: Gentoo
Posts: 145

Original Poster
Rep: Reputation: 15
Thanks for the replies everyone.

Now I know allot more for mime types and such. Coolio...

Actually now I've noticed what it is. Depending on the type of permissions the file has, the level of permissions is somehow mapped to a specific color. So where would I find out how to change the type of colors associated with X level of permissions for a file/directory?

Thanks again,
 
Old 08-07-2003, 03:22 PM   #6
lfur
Member
 
Registered: Jul 2003
Location: Slovenia
Distribution: Slackware & FreeBSD
Posts: 209

Rep: Reputation: 30
digiot,

isn't that:
ls --color=always | less -R

?
 
Old 08-07-2003, 03:29 PM   #7
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
'Specifying --color and no when is equivalent to --color=always.', so sure, it could be. And I'm really not sure about the difference between -r and -R. Apparently they do about the same but I guess -R would be the safer choice?
 
Old 08-07-2003, 04:03 PM   #8
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 45
This link has a table of the colors and other good info:

http://www.faqs.org/docs/linux_intro/sect_03_03.html
 
Old 08-07-2003, 05:24 PM   #9
l0f33t
Member
 
Registered: May 2003
Location: Washington State
Distribution: Gentoo
Posts: 145

Original Poster
Rep: Reputation: 15
Thanks everyone.

Itsjustme, that is exactly what I need and then some. Perfect response to my noobian ways.

Thanks again for everyones response and time.
 
Old 08-07-2003, 10:19 PM   #10
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Rep: Reputation: 31
Code:
alias "less=less -R"
that did the trick..very nice. thx.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Yast/You Color coding linda Suse/Novell 1 08-22-2005 06:07 PM
Shell script to copy file name with part of directory Transition Linux - General 5 01-18-2005 05:40 PM
how do i chage the color of a file or a directory in a bash shell Paxmaster Linux - Software 3 10-17-2004 11:21 PM
vim php color coding? Longinus Linux - Software 4 04-11-2004 05:56 AM
Coding a Shell Smooth Programming 4 09-19-2003 12:59 AM


All times are GMT -5. The time now is 09:13 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration