If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > find command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-21-06, 13:22
pavan_test pavan_test is offline
Registered User
 
Join Date: Oct 2005
Posts: 45
find command

Hi all.,

i am using the follwowing command..
ls -ltr TNT.*.*.*.ctl* | awk -F" " '{print $6" "$7 }'

the output is:
Feb 27
Feb 27
Feb 27
Feb 27
Feb 28
Feb 28
Mar 9
Mar 21
Mar 21

from this output i am trying to get the FIND the files on march 21. i am using the find command no results.

can anyone please give me some suggestions

thanks
pavi
Reply With Quote
  #2 (permalink)  
Old 03-21-06, 13:51
pavan_test pavan_test is offline
Registered User
 
Join Date: Oct 2005
Posts: 45
find command

HI all.,

this is what i am trying to accomplish exactly;


i have a dir and inside that i have certain files. files keep arriving in that dir. the dir has lot of files but i have to process only those files that arrive today.

for eg: today is mar 21 so i have to process only those files that arrived today.

each dir comes with a prefix TNT and suffix as ctl*
so i tried to use this command;
ls -ltr TNT.*.*.*.ctl* | awk -F" " '{print $6" "$7 }'
the output is:
Feb 27
Feb 27
Feb 27
Feb 27
Feb 28
Feb 28
Mar 9
Mar 21
Mar 21

now i know that today ( Mar 21) there are 2 files that arrived. so i have to pick up ( or find ) these 2 files that arrived today and process them.

thanks
pavi
Reply With Quote
  #3 (permalink)  
Old 03-21-06, 14:44
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Cool


If you need the files arrived within the last 24 hours use:
Code:
find . -name TNT.*.*.*.ctl* -mtime -1

__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #4 (permalink)  
Old 03-22-06, 04:12
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
To find all files created on or after 21 March 2006 00:00:00
touch -t 200603202359.59 /tmp/reffile
find . -name TNT.*.*.*.ctl* -newer /tmp/reffile
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On