Get most recent file in a directory on Linux

ack picture ack · Jun 19, 2009 · Viewed 274.2k times · Source

Looking for a command that will return the single most recent file in a directory.

Not seeing a limit parameter to ls...

Answer

ls -Art | tail -n 1

Not very elegant, but it works.