Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to change the order of displayed columns when running ls -l on *nix (or dir on Windows)?

For example, I'd like to see the date modified, then the name, then other fields (or select only the ones I want, and their order.

How would this be done without merely using cut and trimming undesired fields (since that does not address the issue of re-ordering)?

share|improve this question
as a note regarding cut, you'd get more milage out of awk in this case. ls -al | awk '{print $3 " " $1}' – Sirex Jul 15 '11 at 11:27

I'd avoid parsing ls at all: use stat and sort:

stat --printf="%y\t%n\t%F\t%s\n" * | sort -t $'\t' -k 2

is a start.

share|improve this answer

Your Answer


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.