Bash: Return the most recently edited file in a specified directory For a bash script I am currently developing I want to access the name of the most recently edited file (including folders but not subdirectories) in a specified directory. How do I do this?
As @fedorqui suggested You can do:

ls -1t | awk '{ print $9; exit}'

Old post:

You can get it using awk and tail

ls -lrt /path/to/folder/ | tail -1 | awk '{ print $9 }'