dcsimg
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

Re-Imagining Linux Platforms to Meet the Needs of Cloud Service Providers


[ 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: