Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible for less output to set the tab width to a number X as it is for cat?

share|improve this question
1  
You don't need to change the tabs length setting to output a file with reduced tab size. Just use expand instead of cat, like so: expand -4 residuum.txt. –  dotancohen Jul 30 at 16:49

2 Answers 2

up vote 23 down vote accepted

Yes, it is possible with less -x or less --tabs, e.g. less -x4 will set the tabwidth to 4.

share|improve this answer
    
Thanks for your fast response! Didn't find the option. I'll accept your answer as soon as it is possible :)! –  polym Jul 30 at 14:32

The less-specific answer has already been given, but a generic solution (for any pager) is to expand the tabs (with space characters) with the expand command before feeding to the pager:

expand -t4 file | pager
share|improve this answer
    
Ah ok :), good to know! Works like a charm. –  polym Jul 30 at 14:37

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.