The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Getting modified time & filename only senthil_seera Shell Programming and Scripting 4 04-13-2008 09:50 AM
deleting files based on file name and modified time ammu UNIX for Dummies Questions & Answers 1 01-22-2008 07:09 AM
Find files based on time budrito UNIX for Advanced & Expert Users 4 10-08-2004 02:18 AM
find filename based on file content kollerj UNIX for Dummies Questions & Answers 4 06-02-2001 10:31 AM
search for hardlinks based on filename via find command hunternjb UNIX for Dummies Questions & Answers 2 03-26-2001 09:07 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-18-2008
Registered User
 

Join Date: Feb 2008
Posts: 1
Find and store files based on FileName and Modified Time

Hi,

I am currently using the following command:
files=(ls enuCPU??.????.exp ntuCPU??.????.exp)

I need to now change the commmand to store the file names of files that have been modified before datetime equal to say '02/16/2008 20:30:00'

What could I use?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-19-2008
Moderator
 

Join Date: Dec 2003
Location: /dev/florida
Posts: 954
Using the touch command you can create a file with a specific date/time. You can then use the find command with the -newer option to find the files you want. i.e. find ./ ! -newer touchfile -print
Reply With Quote
  #3 (permalink)  
Old 02-19-2008
Registered User
 

Join Date: Jan 2007
Posts: 366
Quote:
Originally Posted by fpmurphy View Post
Using the touch command you can create a file with a specific date/time. You can then use the find command with the -newer option to find the files you want. i.e. find ./ ! -newer touchfile -print

To be complete:

find . ! -newer touchfile -name enuCPU\?\?.\?\?\?\?.exp -o -name ntuCPU\?\?.\?\?\?\?.exp -print

Wildcards need to be escaped to avoid interpretation by the shell.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:12 PM.


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 Global Fact Book

Content Relevant URLs by vBSEO 3.2.0