Is there a way to emulate/improve on the behavior of BSD's column -t in less? i.e. to set the value of less -x/--tabs=... automatically so that each column is 2 characters wider than the widest encountered value in this column?

  • 4
    Why not column -t ... | less? – Arkadiusz Drabczyk Apr 26 '17 at 19:55
  • This is what I'm currently doing, but native support would be more practical, if it exists – n.caillou Apr 26 '17 at 23:50
  • Why do you think it would be more practical? I don't think so. In Unix there should be many small programs doing simple things and doing complex things together. – Arkadiusz Drabczyk Apr 27 '17 at 14:17
  • 1
    This is entirely a matter of opinion, but I don't think that vi, emacs or even nano are simple at all. I would argue that less is already a text user interface with advanced functionalities anyway; if I wanted absolute simplicity I'd stick with head, tail & sed. – n.caillou Apr 27 '17 at 16:09
  • 1
    I know it's a matter of opinion, I expressed mine. Now, if you think that less should have this option nothing stops you from adding it and sending a patch to the maintainers. – Arkadiusz Drabczyk Apr 27 '17 at 16:22

I use the following command, and it works wonders displaying tabular data. It is saved as a function in my environment, and it can take data from stdin and file paths. I like this feature because, with awk, I can filter out the information I don't care about in large text files and then send it to a reader.

powerReader() { column -t -s$'\t' "$@" | less -S; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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