LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-27-2005, 07:36 PM   #1
Dankles
Member
 
Registered: May 2004
Location: /dev/null
Distribution: Slackware
Posts: 245

Rep: Reputation: 31
make 'ls | less' keep colors


I regularly use the 'ls -X | less' commands to look through a list of files. I like how my terminal will display colors with the 'ls' command, but when the 'less' command is piped into it, my colors go away. I know this is normal, but i was just wondering if there was any way to keep my colors.

Thanks Guys

Last edited by Dankles; 10-27-2005 at 07:39 PM.
 
Old 10-27-2005, 08:49 PM   #2
elyk
Member
 
Registered: Jun 2004
Distribution: Slackware
Posts: 198

Rep: Reputation: 32
Change this line in /etc/profile:

export LESS="-MR"
 
Old 10-27-2005, 08:54 PM   #3
elyk
Member
 
Registered: Jun 2004
Distribution: Slackware
Posts: 198

Rep: Reputation: 32
wait a minute, this is what you need to do: edit /etc/DIR_COLORS

# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR all

I'm not sure if you need the R option with less to get it to work, but you need this to pipe the color from ls to less.
 
Old 10-28-2005, 10:20 AM   #4
Dankles
Member
 
Registered: May 2004
Location: /dev/null
Distribution: Slackware
Posts: 245

Original Poster
Rep: Reputation: 31
Hey thanks elyk ,
This works great, and yes, the "-R" option is required.
 
  


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
colors? kaens DamnSmallLinux 5 02-10-2005 03:34 AM
colors when i ls Longinus Linux - Newbie 2 04-28-2004 02:35 AM
colors? there is no god Linux - Newbie 3 08-18-2003 09:04 PM
Colors jeremy LQ Suggestions & Feedback 4 06-26-2003 05:27 AM
su colors PhoenixIce Slackware 2 12-16-2002 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:05 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