|
|
10.3: Colored output from 'ls' (revisited)
My aliase to 'ls -alG | more' does not work. I can get colors in my tcsh shell (and bash) if I type 'ls -alG', but I would really like the contents to pipe through more. If I try to pipe it, I don't get colors anymore... almost as if it just sees 'ls -la | more'
10.3: Colored output from 'ls' (revisited)
Yes! Check the man page. There is an environment variable you must set, I think it's CLICOLOR_FORCE. Note that this might cause ls to *break* in certain situations. I noticed it broke a gnu configure script I was running at one point. Workaround so that it doesn't break other things: modify your alias to set the variable, run the command, then unset the variable. (yes, a bit cumbersome.)
10.3: Colored output from 'ls' (revisited)
You also need to tell more to translate the escape sequences into colors. The -r option of more (or less) should do that, so just a simple 'alias more more -r" should work.
10.3: Colored output from 'ls' (revisited)
Awesome hint. Thanks all! |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.24 seconds |
|