Linux Today: Linux News On Internet Time.





More on LinuxToday


Linux - Find latest file in a directory

Feb 26, 2009, 06:02 (2 Talkback[s])

WEBINAR: On-Demand

No-Size-Fits-All! An Application-Down Approach for Your Cloud Transformation REGISTER >

[ Thanks to Jadu Saikia for this link. ]

"The intention is to print the last field of the last line (except the dir old) from the "ls -lrt" output in that directory.

"$ ls -lrt | awk '/nmn_log/ { f=$NF };END{ print f }' nmn_log.23239.txt"

Complete Story

Related Stories: