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)?

link|improve this question

1  
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
feedback

1 Answer

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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