more ls colors?
November 29, 2007 2:29 PM   Subscribe

Linuxn00bfilter. I'm using "la" to alias "ls -lAXh" and it gives me happy colors for different types of stuff, but if I add a "|more" to that, the colors get stripped. Is there anything I can do about that?
posted by juv3nal to Computers & Internet (6 answers total) 3 users marked this as a favorite
 
Best answer: The default of --color in this case is likely "auto", which only passes color control codes to tty output. You can add --color=always to your alias to force this.

Note that your pipe needs to be able to receive the codes.
posted by kcm at 2:32 PM on November 29, 2007


Best answer: ls -IAXh --color=always|less -R
posted by toxic at 2:34 PM on November 29, 2007 [2 favorites]


Response by poster: thanks.
posted by juv3nal at 2:39 PM on November 29, 2007


And less is more.

Which is to say, less has better features, like being able to scroll in both directions.
posted by quin at 4:43 PM on November 29, 2007


Response by poster: I'm well acquainted with why people prefer less, but the thing is with less, if I scroll all the way to the end thinking I'm done and hit q, I can't scroll back up and find something if I made a mistake in quitting out. That's not the case with more.
posted by juv3nal at 4:48 PM on November 29, 2007


Fair enough. I find that there are still quite a few people who don't use 'less' because they think that it'll have fewer features than 'more' based on the name.

Clearly you are not one of them. :)
posted by quin at 5:06 PM on November 29, 2007


« Older Complimentary service.   |   Help put together my setlist Newer »
This thread is closed to new comments.