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
How to list files Created in last 2 hrs rsonakiya UNIX for Dummies Questions & Answers 4 03-02-2009 06:25 AM
Files created in last 24 hours jayaramanit Shell Programming and Scripting 1 09-08-2007 04:34 AM
Finding files which are modified few mins ago rajus19 Shell Programming and Scripting 3 08-16-2007 08:32 AM
Files created by particular user Anshu UNIX for Dummies Questions & Answers 2 06-13-2006 08:12 AM
Two Files Created For Every One? Atama UNIX for Dummies Questions & Answers 1 04-12-2002 04:44 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-03-2005
Registered User
 

Join Date: Aug 2003
Location: Ireland
Posts: 274
files created within last 10 mins

Any simple 1 liners to check a directory to see if a file was created within the last 10 mins?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-03-2005
blowtorch's Avatar
Supporter
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,349
Maybe this will help.

Code:
touch /some_dir/some_file; sleep 600; find /some_dir -newer /some_dir/some_file
Reply With Quote
  #3 (permalink)  
Old 08-03-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,772
find /dir/to/search -name '*.*' -cmin 10

See man find to look for more time based options.

Vino
Reply With Quote
  #4 (permalink)  
Old 08-03-2005
Registered User
 

Join Date: Jul 2005
Location: England
Posts: 183
GNU find will allow you to find files in this fashion .. although you wont be able to use the creation date .. the 3 options are: -amin -cmin and -mmin for access, status change and modified stamps.
Reply With Quote
  #5 (permalink)  
Old 08-03-2005
Registered User
 

Join Date: Aug 2003
Location: Ireland
Posts: 274
Seems like this is my best option so far:
touch /some_dir/some_file; sleep 600; find /some_dir -newer /some_dir/some_file

As I cannot install GNU find - as I want to run this on many servers and most of which I dont have root access...


The command above will list only the file name that are found to be newer..
How can I list the date/timestamp of only the files found aswell?
Reply With Quote
  #6 (permalink)  
Old 08-03-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,772
Quote:
Originally Posted by frustrated1
Seems like this is my best option so far:
touch /some_dir/some_file; sleep 600; find /some_dir -newer /some_dir/some_file

As I cannot install GNU find - as I want to run this on many servers and most of which I dont have root access...


The command above will list only the file name that are found to be newer..
How can I list the date/timestamp of only the files found aswell?
find /some_dir -newer /some_dir/some_file -name '*.*' -exec ls {} \;

Vino
Reply With Quote
Google The UNIX and Linux Forums
Reply

Bookmarks

Tags
None

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:




All times are GMT -4. The time now is 08:34 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66