Looking for a command that will return the single most recent file in a directory.
Not seeing a limit parameter to ls
...
ls -Art | tail -n 1
returns the latest modified file or directory.
Flags:
-A
list all files except .
and ..
-r
reverse order while sorting
-t
sort by time, newest first