The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-03-2005
frustrated1 frustrated1 is offline
Registered User
  
 

Join Date: Aug 2003
Location: Ireland
Posts: 278
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?
  #2 (permalink)  
Old 08-03-2005
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

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

Code:
touch /some_dir/some_file; sleep 600; find /some_dir -newer /some_dir/some_file
  #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,796
find /dir/to/search -name '*.*' -cmin 10

See man find to look for more time based options.

Vino
  #4 (permalink)  
Old 08-03-2005
Unbeliever Unbeliever is offline
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.
  #5 (permalink)  
Old 08-03-2005
frustrated1 frustrated1 is offline
Registered User
  
 

Join Date: Aug 2003
Location: Ireland
Posts: 278
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?
  #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,796
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
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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