Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-10-2009, 05:17 AM   #1
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
Registered: Aug 2005
Posts: 65

Rep: Reputation: 31

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
Registered: Oct 2007
Distribution: Fedora, openSUSE
Posts: 252

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



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
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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:11 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration