The UNIX and Linux Forums  

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
Shell script help to eliminate files of todays date richM Shell Programming and Scripting 2 04-20-2009 04:40 AM
Comparing the file drop date with todays date Rajneel Linux 3 03-26-2009 05:06 AM
using todays date to create a report using grep MBN Shell Programming and Scripting 3 11-02-2008 04:14 AM
List certain file in a folder and make list andrisetia UNIX for Dummies Questions & Answers 1 09-15-2008 02:21 PM
want to delete timestamp from todays file maverick Shell Programming and Scripting 5 11-07-2003 08:07 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-17-2009
unx100 unx100 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 22
How to list todays file


Code:
 
Hi Friends,
 
How to list todays file from a directory listing of files for amny dates.
 
I tried with the following options but not working :
 
find . -name "esi01v*" –mtime 1 –ls find . -name "esi01v*" –ctime 1 –ls find . -name "esi01v*" -mtime 1 Please advise

  #2 (permalink)  
Old 07-17-2009
rakeshawasthi rakeshawasthi is offline
Registered User
  
 

Join Date: Aug 2004
Location: India
Posts: 379
Try:

Code:
find . -type f -mtime 1 -exec ls {} \+

  #3 (permalink)  
Old 07-17-2009
unx100 unx100 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 22
please tell me where do I give the pattern like abcd* or esi001*
  #4 (permalink)  
Old 07-17-2009
panyam panyam is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2008
Posts: 474
something like this :

Code:
find . -name "esi01v*"  -type f –ctime 0 | xargs ls -l

  #5 (permalink)  
Old 07-17-2009
unx100 unx100 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 22
Hi Panyam,

I tired but it is listing yesterdays files also

tried with -ctime with 0 1 etc but not the correct results
  #6 (permalink)  
Old 07-17-2009
rakeshawasthi rakeshawasthi is offline
Registered User
  
 

Join Date: Aug 2004
Location: India
Posts: 379
then modify that script a bit...

Code:
find . -name "esi01v*" -type f -mtime 1 -exec ls {} \+

  #7 (permalink)  
Old 07-17-2009
unx100 unx100 is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 22
HI Rakesh,

afraid...not working. itried other options in the above command line as well but not getting the desired results.

is there anyway i can match todays date Jul 17 with the ls -lrt command date and extract file

like :
date | awk '{print $2}' | cut -c 1-3 > this command will return Jul
date | awk `{print $3}` > will return 17

ls -lrt esi01v* | awk '{print $6 $7}' > will return Jul 17

is it possible to concatenate the first 2 match with the 3rd and list files
Reply

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 05:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
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