Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

ls -l gives me color coded output. Folders are blue, executables green, etc. These colors are gone when filtering thorough | more. Anyway to achieve both paged output and colors?

share|improve this question
    
Can you give us a detailed explanation? –  Random Guy Oct 5 '11 at 11:21

2 Answers 2

up vote 6 down vote accepted

Try with less command with repaint(-R) option:

ls --color=always -l | less -R
share|improve this answer
    
That works, and actually more as pager also works. –  eldering Oct 5 '11 at 11:29
1  
Shouldn't it be -R (only change is uppercase R)? See here for why... –  Breakthrough Oct 5 '11 at 11:37
    
@Breakthrough: +1. i'll update it. –  Prince John Wesley Oct 5 '11 at 11:39
2  
Actually it also works with more with the --color=always, so that was the key for me! –  Nilzor Oct 7 '11 at 8:11

Search for the term "escape sequence" in the man page of less. About the colorful stuff, see ANSI escape code # Colors;

There is a detailed solution on askubuntu.com on how to have paged & colored output; the key info is:

ls -C --color=always | less -R
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.