LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 07-14-2008, 08:20 PM   #1
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Rep: Reputation: 30
How to enable text color to differentiate files and directories?


Can the text output of 'ls' be enabled with color to differentiate between files, directories and symbolic links?

Thanks.
 
Old 07-14-2008, 08:50 PM   #2
rlhartmann
Member
 
Registered: Mar 2008
Posts: 73

Rep: Reputation: 16
Most versions of ls in linux support it if your terminal supports color.

Try:

ls --color
or
ls --color -F

You can set ls to use this by default by adding

alias ls='ls --color -F'

to your ~/.bashrc and/or ~/.bash_profile
 
Old 07-14-2008, 08:57 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by Akhran
Can the text output of 'ls' be enabled with color to differentiate between files, directories and symbolic links?
Is this still tcsh you're asking about? If so, one option is to add setenv CLICOLOR to your ~/.cshrc.
 
Old 07-15-2008, 01:26 AM   #4
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Original Poster
Rep: Reputation: 30
That is spot on.

Thank you !

Quote:
Originally Posted by anomie View Post
Is this still tcsh you're asking about? If so, one option is to add setenv CLICOLOR to your ~/.cshrc.
 
Old 07-15-2008, 10:06 PM   #5
r_mosaic
LQ Newbie
 
Registered: Jul 2007
Posts: 3

Rep: Reputation: 0
Smile

I guess 'ls --color=auto' is better. This will make 'ls' use color when displaying on the console and not use color when sending to a pipe.
 
  


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
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 02:19 AM
differentiate text files packets Programming 3 01-30-2008 08:40 PM
How to make the directories and files in color in the terminal leonall Linux - Newbie 1 03-09-2006 09:13 PM
Perl: Search and replace directories within text files Erhnam Programming 2 03-07-2006 04:07 AM
replace text in files and directories rincewind Linux - Software 4 10-27-2004 11:29 AM


All times are GMT -5. The time now is 03:34 AM.

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