ack ack - 1 year ago 121
Linux Question

Linux: Most recent file in a directory

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

Not seeing a limit parameter to ls...

Answer Source
ls -Art | tail -n 1

Not very elegant, but it works.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download