Looking for a command that will return the single most recent file in a directory.
Not seeing a limit parameter to ls...
ls
ls -Art | tail -n 1
Not very elegant, but it works.
Used flags:
-A list all files except . and ..
-A
.
..
-r reverse order while sorting
-r
-t sort by time, newest first
-t
2.1m questions
2.1m answers
62 comments
56.6k users