简体   繁体   中英

Kornshell (ksh) listing/sorting files

How would I sort files by modification time (most recent at the top) and only have one column?

I tried:

    ls -1 | ls -lt

and

    ls -lt | -1

but the first has extraneous columns, and the second lists them in one column, but in the wrong order.

ls "filepath" -t -1 

this will sort the date last modified and print out 1 row at a time.

I don't think you can do both with piping unless you want to have it list twice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM