ls -Art | tail -n 1
This will return the latest modified file or directory. Not very elegant, but it works.
Used flags:
-A list all files except . and ..
-r reverse order while sorting
-t sort by time, newest first
ls -Art | tail -n 1
This will return the latest modified file or directory. Not very elegant, but it works.
Used flags:
-A list all files except . and ..
-r reverse order while sorting
-t sort by time, newest first