LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 03-10-2009, 05:17 AM   #1
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Rep: Reputation: 39
Preserving colours with less


Is it possible for less to display coloured text, if that's what it's reading from stdin? I tried the -r and -R flags but they don't do it, at least not when reading the output of ls --color=auto.
 
Old 03-10-2009, 05:41 AM   #2
Vrajgh
Member
 
Registered: Aug 2005
Posts: 68

Rep: Reputation: 33
Try

Code:
ls --color=always | less -r
The problem you are having is with ls, not less. When using --color=auto, ls will not include color characters if the output is a pipe (like it is if it is piped to less.)
 
Old 03-10-2009, 06:03 AM   #3
openSauce
Member
 
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

Original Poster
Rep: Reputation: 39
Thanks, that works!
 
  


Reply

Tags
color



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
Preserving Partitions tshaw Linux - General 1 11-07-2006 12:07 PM
Preserving Permissions RemusX2 Linux - Software 2 07-10-2005 11:20 AM
scp with preserving permissions pradi_net Linux - Software 1 06-08-2004 08:00 AM
Preserving permissions when using cp pilot1 Linux - General 2 08-16-2003 05:29 AM
preserving konsole colours kazuni Linux - Newbie 2 06-03-2003 08:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:52 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
Open Source Consulting | Domain Registration