File creation time in UNIX | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    

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 !!

File creation time in UNIX

UNIX for Dummies Questions & Answers

Closed Thread    
Thread Tools Search this Thread Display Modes
Old 06-25-2013
Balasankar Balasankar is offline
Registered User
Join Date: Jun 2013
Last Activity: 14 May 2014, 10:20 AM EDT
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
File creation time in UNIX

Hi All,

Can any one help how to long list today's files in unix.i.e files which are have been created today should be able to "ls -ltr" .I should be able to apply the "ls -ltr" command on today's files(should not include all the files which were there in the directory).

Thanks in advance!!!

Last edited by Balasankar; 06-25-2013 at 07:24 AM..
Sponsored Links
Old 06-25-2013
rangarasan's Avatar
rangarasan rangarasan is offline
Registered User
Join Date: Jul 2011
Last Activity: 24 February 2015, 3:14 AM EST
Location: Chennai, India
Posts: 496
Thanks: 9
Thanked 124 Times in 120 Posts


You could use the find command's mtime option to accomplish this task.

find /target/directory/ -type f -mtime -1 -exec ls -ltr {} \;

Sponsored Links
Old 06-25-2013
rbatte1 rbatte1 is offline Forum Staff  
Join Date: Jun 2007
Last Activity: 26 February 2015, 9:56 AM EST
Location: Lancashire, UK
Posts: 2,105
Thanks: 693
Thanked 374 Times in 333 Posts
The suggestion from rangarasan will be fine if you are searching for Modify Time. This can get a bit confusing though as the file may have been created some time ago, but modified today.

I don't think that there is a simple way to get creation time. You could look at the directory and that will have a timestamp when any file is created or deleted, but you won't know which. Perhaps you would have to write an audit type job to list the files off periodically and see what changes when.

Old 06-25-2013
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
Join Date: Mar 2005
Last Activity: 20 September 2013, 10:59 AM EDT
Location: Philadelphia metro
Posts: 958
Thanks: 3
Thanked 67 Times in 60 Posts
try this one ...

cd /dir
ls -lrt $(find . -type d -mtime 1 | egrep -v "[\.\.|\.]") | grep "Jun 25"

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
File creation time mastansaheb Red Hat 2 12-19-2012 05:21 AM
About Unix File creation time gaellafond UNIX for Dummies Questions & Answers 4 11-21-2011 12:02 PM
File creation time mr_manii Programming 2 08-28-2009 08:56 AM
Unix File creation time tinivt Shell Programming and Scripting 2 01-23-2007 06:27 AM
Listing the creation date/time of a file in unix unipepper Shell Programming and Scripting 6 02-15-2006 07:10 AM

All times are GMT -4. The time now is 08:58 PM.