LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-15-2008, 01:41 PM   #1
tvisher
LQ Newbie
 
Registered: Jul 2005
Distribution: Slackware 10.0
Posts: 12

Rep: Reputation: 0
Is it possible for less to display colors from a grep search?


Hey Everyone,

I'm trying to have less display the colors from various commands such as grep and ls. So far, I've found the -R and -r options but they don't appear to do anything. Is this possible? I use less all the time to page through results and it's just annoying that it doesn't display colors.

Thanks in advance!
 
Old 12-15-2008, 03:22 PM   #2
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
It's actually not a `less' problem. When you do ls | something, it detects that it is not connected to a terminal capable of colours, and so it doesn't output any.
 
Old 12-15-2008, 03:22 PM   #3
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
Try this on for style

Code:
ls --color=always | less -R
 
1 members found this post helpful.
  


Reply

Tags
bash, colors, less



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 to search files apart from GREP?? kapilbajpai88 Linux - Newbie 6 07-24-2008 11:15 AM
grep search... tobiasw Linux - General 4 10-28-2006 01:36 PM
To recursively search with grep grautu Slackware 5 11-21-2005 02:53 AM
Using Grep to search all sub-directories yrraja Solaris / OpenSolaris 2 08-28-2004 03:29 AM
Grep for search, but what for replace? TheSpecial Linux - Software 18 04-28-2003 09:01 AM

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

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

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