The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can I know find syntax to find given date files bache_gowda Shell Programming and Scripting 3 03-26-2008 03:37 AM
Find duplicates from multuple files with 2 diff types of files ricky007 Shell Programming and Scripting 2 03-04-2008 10:46 AM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 03:47 AM
how to find duplicate files with find ? umen Shell Programming and Scripting 8 09-04-2006 12:01 AM
Find files older than 20 days & not use find halo98 Shell Programming and Scripting 2 05-18-2006 11:19 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-24-2006
Registered User
 

Join Date: Sep 2006
Posts: 2
Angry find files

gents

i need to look for a file with the latest date ... to make it clearer, here's what it looks like:
/afc/data/EOD/Eoddev/Enqueue/Devices/Processed/060920212734/CDAuthorisedSet_0_7408.xml
/afc/data/EOD/Eoddev/Enqueue/Devices/Processed/060920214314/CDAuthorisedSet_0_7409.xml
/afc/data/EOD/Eoddev/Enqueue/Devices/Processed/060920220617/CDAuthorisedSet_0_7410.xml
/afc/data/EOD/Eoddev/Enqueue/Devices/Processed/060920231041/CDAuthorisedSet_0_7411.xml
/afc/data/EOD/Eoddev/Enqueue/Devices/Processed/060920232725/CDAuthorisedSet_0_7412.xml
/afc/data/EOD/Eoddev/Enqueue/Devices/Processed/060921003333/CDAuthorisedSet_0_7413.xml

now i need to find the latest CDAuthorisedSet_*.xml file ... how can i do that ...

ive been trying to find out a solution but cant seem to find it ..

here's my find command:
find /afc/data/EOD/Eoddev/Enqueue/Devices/Processed -name "CDAuthorisedSet*" -type f -print

this finds all the above files but who can i specify to use the one with the latest date ..

thanks
miles1982
Reply With Quote
Forum Sponsor
  #2  
Old 09-24-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,328
How about just
Code:
cd /afc/data/EOD/Eoddev/Enqueue/Devices/Processed; ls -lt CDAuthorisedSet*|head -1
Reply With Quote
  #3  
Old 09-24-2006
Registered User
 

Join Date: Sep 2006
Posts: 2
yes i figured it out ...

did the following:

ls -l afc/data/EOD/Eoddev/Enqueue/Devices/Processed/*/CDAuthorisedSet_*.xml | tail -1;

thanks anyway
miles1982
Reply With Quote
  #4  
Old 09-25-2006
Registered User
 

Join Date: Jul 2006
Posts: 49
hi

Try this

path - -> path of the file
age - -> how old file ur trying to retrive
find ${path} -atime +${age} -exec ls -l {} \;
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0