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 > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Insert file names when concatenate files into a file samky2005 Shell Programming and Scripting 2 06-05-2009 06:07 PM
find for specific content in file in the directory and list only file names madhu_Jagarapu AIX 2 12-23-2008 02:13 AM
Finding & Moving Oldest File by Parsing/Sorting Date Info in File Names nikosey Shell Programming and Scripting 6 07-30-2008 09:46 PM
Reading file names from a file and executing the relative file from shell script anushilrai Shell Programming and Scripting 4 03-10-2006 05:25 AM
To get the file names. surjyap Shell Programming and Scripting 1 10-10-2005 07:11 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 4 Weeks Ago
bbbngowc bbbngowc is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 194
Can I search between file names?

Hi,

I have a large number of files that have in the file name a date stamp such as "091021". Is there a way to search for files where the name falls between dates in the name?

Ex: find . -type f -name "*091001* - *091021*" -exec ls -l {} \;

Something like that.
  #2 (permalink)  
Old 4 Weeks Ago
dukessd dukessd is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2006
Posts: 307
awk is your friend:.

Eg:

ls <dir> | awk '$0>=from&&$0<=to' from="*091001*" to="*091021*"

or

find . | awk '$0>=from&&$0<=to' from="*091001*" to="*091021*"

HTH
  #3 (permalink)  
Old 4 Weeks Ago
bbbngowc bbbngowc is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 194
This is not working for me. Keeps going to the next line as if it's not finding anything. Here's what I'm typing:

Code:
find . | awk '$0>=from&&$0<=to' from="*090801*" to="*090930*"
I also tried:

Code:
find . -type f | awk '$0>=from&&$0<=to' from="*090801*" to="*090930*"
Keeps coming back blank. I can do an ls -l and see files that should be displayed. Am I doing something wrong?
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:30 PM.


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