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
Find files size 0 within a directory astonmartin Shell Programming and Scripting 3 02-07-2008 04:49 PM
Find files in directory and its subdirectory jyotib Shell Programming and Scripting 11 01-24-2008 04:19 PM
find files and copy into a directory balireddy_77 Shell Programming and Scripting 4 04-27-2007 04:38 AM
How to find the count of files in a directory sish78 UNIX for Dummies Questions & Answers 5 02-01-2007 03:58 PM
find directory with 2 types of files dangral UNIX for Dummies Questions & Answers 2 10-13-2004 02:51 PM

Closed Thread
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 09-28-2008
coldstarhk coldstarhk is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 3
Find files in directory

Hi all
I want to find a particular file type lets say .abc under /home/oracle/, the file name is start with 'D' and followed by ddmmyyyy date format, the file name should look like this D19092008.abc To my question, how can i perform the searching from the date 19/09/2008 to 29/09/2008. The folder contains many files, to speed up the searching, i tried the following script :
for i in `find /home/oracle/ -name D*.abc`
Can i set the date range to the file name?

Regards
  #2 (permalink)  
Old 09-28-2008
./hari.sh's Avatar
./hari.sh ./hari.sh is offline
Registered User
  
 

Join Date: Jul 2007
Location: India
Posts: 44
Last 10 days file you may use this script


Code:
find /home/oracle/D -mtime -20 | grep .abc

  #3 (permalink)  
Old 09-28-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,437
Why find when you can list the content/time range?

Code:
$ ls /home/oracle/D{19..29}092008.abc 2>/dev/null

  #4 (permalink)  
Old 09-29-2008
coldstarhk coldstarhk is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 3
Thanks danmero, it works prefectly with your script, however, when i try to convert to this


Code:
for j in `ls /home/oracle/D{$day1..$day2}*.abc 2>/dev/null`

It doesnt show anything. $day1 and day2 are the day of the month

One more question, could it be possible to set the range not only for the day, but also include the month.

Thanks many
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 01:47 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