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 find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 4 Weeks Ago 09:37 AM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 05:12 PM
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
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 03:38 PM
how to find a file in UNIX without find command? bluo Shell Programming and Scripting 3 09-24-2003 08:47 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 03-21-2006
Registered User
 

Join Date: Oct 2005
Posts: 44
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
Forum Sponsor
  #2  
Old 03-21-2006
Registered User
 

Join Date: Jan 2005
Posts: 682
Show how you are using the "find" command. Your output cannot be used in the find command since the "Mar 21" string is not stored anywhere in this format.
Reply With Quote
  #3  
Old 03-21-2006
Registered User
 

Join Date: Jan 2005
Posts: 682
Now that I think of it, this is probably what you are attempting to do:
Code:
find . -name TNT.*.*.*.ctl* -exec ls -ltr {} \; | grep "Mar 21"
Reply With Quote
  #4  
Old 03-21-2006
Registered User
 

Join Date: Oct 2005
Posts: 44
find command

Hello.,

i am trying to accomplish is;

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
  #5  
Old 03-21-2006
Registered User
 

Join Date: Oct 2005
Posts: 44
find command

Hello.,


find INFOSCAN.*.*.*.ctl* -exec ls -ltr {} \; | grep "Mar 21"

the above command is working. but can nayone suggets me isntead of hard coding "Mar 21 " how can i get all the files for today's date.

thanks
pavi
Reply With Quote
  #6  
Old 03-21-2006
Registered User
 

Join Date: Jan 2005
Posts: 682
Find gives you this already, there isn't any need to "ls" and "awk".

Try this:

find . -name TNT.*.*.*.ctl* -mtime 1

This will look for all new files matching your spec modified today.
Reply With Quote
  #7  
Old 03-21-2006
Registered User
 

Join Date: Oct 2005
Posts: 44
find command

Hello tmarikle

thanks man..your suggestion did wonders for me..

thanks a lot buddy..

have a nice day !!!
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
mtime

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:21 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