The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to find files older than 2 hours pt14 AIX 3 03-05-2008 12:31 PM
how to find files older than 4hours in HP-UX caprikar UNIX for Advanced & Expert Users 3 11-27-2007 05:23 PM
display the files in a folder which are older than 1 hour vgs Shell Programming and Scripting 7 05-29-2007 02:05 PM
display the files in a folder which are older than 1 hour vgs UNIX for Dummies Questions & Answers 3 05-25-2007 08:46 PM
Find files older than 20 days & not use find halo98 Shell Programming and Scripting 2 05-18-2006 02:19 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-02-2009
kedar.mehta kedar.mehta is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 18
Find files older then today & display with timestamp info

Small query-

I want to do some operation on all the files older then today. Before I do that operation, i want to verify if the command works properly or not.

Surprisingly, the command below returns me file, which are created today -

find /mrk_archive/PG/ftp/incomming/gbs/2008 -type f -mtime +1 -print| ls -lst | more

Is there any other way to see the files selected by find , sorted as per the date with the timestamp information?

Thanks & a Happy New Year !!

Last edited by kedar.mehta; 02-19-2009 at 05:10 PM..
  #2 (permalink)  
Old 01-02-2009
Padow Padow is offline
Registered User
  
 

Join Date: Dec 2008
Location: Maryland
Posts: 177
mtime is the right option, just try incrementing to 2+. BTW, you can use -ls as an option to find rather than print and you won't have to pipe to the ls command.
  #3 (permalink)  
Old 01-02-2009
kedar.mehta kedar.mehta is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 18
Thanks, man..

One surprising thing,

Both of command below returns me the same set of result.
  • find /mrk/ftp/incoming/gbs -type f -mtime +0 -ls
  • find /mrk/ftp/incoming/gbs -type f -mtime +1 -ls
Where as,
find /mrk/ftp/incoming/gbs -type f -mtime 0 -ls
returns results of previsous day.

Consider today is 2nd jan, then it shows all only results of 1st Jan .. !!

Last edited by kedar.mehta; 02-19-2009 at 05:11 PM..
Sponsored Links
Closed Thread

Bookmarks

Tags
files, find, mtime, older, today

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0