ls -qaltr # list directory in chronological order, most recent files at end of list

ls -qaltr # list directory in chronological order, most recent files at end of list
I find it very handy to be able to quickly see the most recently modified/created files in a directory. Note that the "q" option will reveal any files with non-printable characters in their filename.
Sample Output
[mpb@localhost ~]$ ls -qaltr /tmp
total 12
drwxr-xr-x 19 root root 4096 Jan 12 09:12 ../
drwxrwxrwt  2 root root   40 Feb 25 13:29 .XIM-unix/
drwxrwxrwt  2 root root   40 Feb 25 13:29 .Test-unix/
drwxrwxrwt  2 root root   40 Feb 25 13:29 .font-unix/
-rw-r--r--  1 root root  157 Feb 25 13:29 ddebug.log
drwxrwxrwt  2 root root   40 Feb 25 13:29 systemd-private-BsJC1l/
-r--r--r--  1 root root   11 Feb 25 13:29 .X0-lock
drwxrwxrwt  2 root root   60 Feb 25 13:29 .X11-unix/
drwx------  2 root root   40 Feb 25 13:29 pulse-PKdhtXMmr18n/
drwx------  2 root root   60 Feb 25 13:29 gpg-JYxEia/
drwx------  2 root root   60 Feb 25 13:29 gpg-9EimL6/
drwx------  2 mpb  mpb    60 Feb 25 13:29 gpg-0tXbPf/
-rw-------  1 mpb  mpb     0 Feb 25 13:29 xerr-mpb-:0
drwxrwxrwt  2 root root   40 Feb 25 13:29 systemd-private-Agvb8o/
drwx------  2 mpb  mpb    60 Feb 25 13:29 .esd-10001/
drwxrwxrwt  2 root root   60 Feb 25 13:29 .ICE-unix/
drwxrwxrwt  2 root root   40 Feb 25 13:29 systemd-private-q2rBI6/
drwxrwxrwt  2 root root   40 Feb 25 13:30 systemd-private-KBB9hs/
srwxr-xr-x  1 root root    0 Feb 25 13:30 wpa_ctrl_3263-0=
drwx------  2 root root   60 Feb 25 13:31 gpg-dVH2Yz/
drwx------  2 mpb  mpb    80 Feb 25 13:42 CRX_75DAF8CB7768/
drwx------  2 mpb  mpb    80 Feb 25 14:00 .com.google.Chrome.nczGuc/
-rw-rw-r--  1 mpb  mpb     0 Feb 25 14:01 .google-talk-plugin-mpb.lock
drwxrwxrwt  2 root root   60 Feb 25 14:09 systemd-private-Iu9cH6/
drwxrwxrwt 20 root root  500 Feb 25 14:12 ./

7
By: mpb
2013-02-25 14:14:44
at ls

What Others Think

I would prefer to add "h" to the parameters for better readable file sizes. (And create an alias ;-))
danimath · 281 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: