I prefer to set tabs 4 however this may have some side effects, such as for example ls out put may look not properly aligned. How might I configure the terminal / cat to use four spaces for tabs for cat only?Should I just alias / wrap cat to something that sets tabs 4, runs /bin/cat, then sets it back? My thinking is that this route is less preferable since in fact I would like this behaviour for less, diff, and other utilities.
How to set default tabs only for cat?
command line;cat;tabulation
The curses program tabs will allow you to change what the terminal believes to be the width of a ^I. This would make a simple scripttabs -4cat $@tabs -8However, the processing of tab characters on terminals is notoriously wonky and I'm of the impression that you should never mess with them. I suggest using expand as in:expand -4 $@which is actually closer to what you intend.added in reply to comment:Far too many scripts count on cat meaning /bin/cat which explicitly does not change tabs. I'm not sure if you mean to replace or supersede /bin/cat, but you shouldn't. Better would be:alias tcat='expand -4'orfunction tcat() {    expand -4 $@}or similar.