/ Published in: Bash
To find the latest file in a particular dir
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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
URL: http://unstableme.blogspot.com/2008/06/find-latest-file-in-directorybash.html