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
File modification panknil Shell Programming and Scripting 2 10-04-2007 04:04 AM
SED for text file modification gfhgfnhhn Shell Programming and Scripting 6 07-07-2006 05:41 AM
Shell script: last modification date for a file onlyc UNIX for Dummies Questions & Answers 4 07-06-2006 10:01 AM
Search by modification date slink UNIX for Dummies Questions & Answers 5 05-25-2006 03:07 AM
File modification time edog UNIX for Dummies Questions & Answers 1 10-03-2001 09:13 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 12-21-2005
Registered User
 

Join Date: Dec 2005
Posts: 4
Question command for modification date of a file

Good morning,
I would like to find all files of a certain type and display their name as well as their modification date.
In order to do this, I would do the following:

find ./ -name *.csv | ????????

My question: what to put after the pipe instead of the question marks? Is there a basic UNIX command that can determine the modification date of a file?

Thanks
Dominique
Reply With Quote
Forum Sponsor
  #2  
Old 12-21-2005
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
Code:
find . -name '<search_file>' | xargs ls -l | awk '{print $9"   "$6"   "$7"   "$8}'
Reply With Quote
  #3  
Old 12-21-2005
Registered User
 

Join Date: Dec 2005
Posts: 4
Thumbs up Thank you

Hello MatrixMadhan,
I have tried your command, it does exactly what I wanted and I have learned a lot via the 'xargs' command.

Thanks
Dominique
Reply With Quote
  #4  
Old 12-28-2005
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,609
a different way without involving xargs

Code:
find . -name '<search_file>' -ls | awk '{print $11"  "$8"  "$9" "$10}'
Reply With Quote
  #5  
Old 12-28-2005
saneeshjose's Avatar
Registered User
 

Join Date: Dec 2005
Posts: 15
Angry

I am wondering whether

ls -l *.csw

can't give the modification date of a file?
Reply With Quote
  #6  
Old 12-28-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,683
Quote:
Originally Posted by saneeshjose
I am wondering whether

ls -l *.csw

can't give the modification date of a file?
It would work for the current directory. And you will have to do that for each directory. find will find all the files in the specified path which has that extension.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




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