//View Tip #882
» Tar remote dir over SSH
» Get latest stable version of the Linux kernel
» Diff Two Directories
» Command line currency conversion
Rob Hutten
Similar Tips
» Deleting difficult filenames» Tar remote dir over SSH
» Get latest stable version of the Linux kernel
» Diff Two Directories
» Command line currency conversion
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
To find the last modified files in a directory you can use ls -ltr. To find the last modified file on a file system it will not work, but the following command will work:
find /etc -type f -printf "%T@ %T+ %p" | sort -n
Comments
Add your comment
#1
Nice one. I had to add a \n after the %p, though.
Posted 2009-09-15 11:01:36
Yes, I also had to add '\n'. I also piped through 'sort -rn|head' to limit the output. It's also possible to speed things up by using the test '-cnewer' in 'find'. Just picking any file in the directory your searching. If you don't get any output you've managed to pick the most recent modified file.
Posted 2009-09-16 00:30:55
i believe you are a good writer, but have you erver thought to write some special artcals for peopel who likes shopping very much.
Posted 2010-07-15 22:42:45
Fake Perfect <a href="http://www.louisvuittonhandbag … ;>louis vuitton handbags</a>Cheap Chanel Louis Vuitton
Perfect Wallets<a href="http://www.louisvuittonhandbag … a>Swiss The name of
Perfect Wallets<a href="http://www.louisvuittonhandbag … a>Swiss The name of
Posted 2010-08-03 02:32:48

