LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-02-2011, 10:54 AM   #1
threezerous
Member
 
Registered: Jul 2009
Posts: 89

Rep: Reputation: 15
Question In a folder hierarchy, find the last updated file


I have a folder hierarchy with many sub-folder levels under a set of parent folders. Based on the application design and business use, files are written to different locations on a daily basis. I want to find out the last updated file in the folder structure and its location at any given time. How can I do that?

Thanks in advance
 
Old 06-02-2011, 03:25 PM   #2
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
Well;
Code:
ls -lrt |tail -1
may do the work.
 
Old 06-03-2011, 02:07 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
You'll also want the -R flag
http://linux.die.net/man/1/ls
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Folder Hierarchy 1veedo Linux - General 1 07-02-2010 02:00 PM
Find folders with ONLY one specific file in and delete file and folder - How ? gedi1 Linux - Newbie 5 10-21-2009 09:09 PM
find and move to folder and file dulahdaglace Linux - Newbie 1 09-15-2009 11:44 PM
Copy a file into another directory and keep its folder hierarchy? Zebe Linux - General 2 11-25-2008 05:47 PM
SquirrelMail Folder Hierarchy haydenyoung Linux - Newbie 1 10-16-2006 07:09 AM


All times are GMT -5. The time now is 02:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration