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
List directory 7 days older krishnarao Shell Programming and Scripting 3 06-28-2007 01:06 PM
Searching for files over 30 days old in current directory cxredd4 Shell Programming and Scripting 18 06-11-2006 02:16 AM
How to zip a modified file 15 days before but not scanning my sub directory files skrish70 Shell Programming and Scripting 1 10-10-2005 03:41 PM
Removing files automatically from a directory after 30 days. justinb_155 Shell Programming and Scripting 7 06-24-2005 02:07 PM
How to delete files which are 7 days old arunava_maity UNIX for Dummies Questions & Answers 8 05-10-2001 09:31 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-22-2007
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
ls latest 4 days or specify days of files in the directory

Hi,

I would like to list latest 2 days, 3 days or 4 days,etc of files in the directory...

how? is it using ls?
  #2 (permalink)  
Old 01-22-2007
sb008 sb008 is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 384
find . -type f -mtime 2 (exactly 2 days)
find . -type f -mtime +2 (2 days or more)
find . -type f -mtime 3 (exactly 3 days)
find . -type f -mtime +3 (3 days or more)
find . -type f -mtime 4 (exactly 4 days)
find . -type f -mtime +4 (4 days or more)
etc.
  #3 (permalink)  
Old 01-22-2007
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
Quote:
Originally Posted by sb008
find . -type f -mtime 2 (exactly 2 days)
find . -type f -mtime +2 (2 days or more)
find . -type f -mtime 3 (exactly 3 days)
find . -type f -mtime +3 (3 days or more)
find . -type f -mtime 4 (exactly 4 days)
find . -type f -mtime +4 (4 days or more)
etc.
can you provide an example for me?
  #4 (permalink)  
Old 01-22-2007
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 578
Quote:
Originally Posted by happyv
can you provide an example for me?
You still need an example? That was complete solution to your problem, try sb008's suggestions please.
Sponsored Links
Closed Thread

Bookmarks

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 06:06 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