/ Published in: Bash
URL: http://unstableme.blogspot.com/2008/06/find-latest-file-in-directorybash.html
To find the latest file in a particular dir
Expand |
Embed | Plain Text
way 1: $ ls -lrt | awk '{ f=$NF }; END{ print f }' The above awk is to print the last argument of the last line way 2: $ ls -t1 | head -n1
You need to login to post a comment.
