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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find the length of file names in a directory? koti_rama Shell Programming and Scripting 5 06-04-2008 10:19 AM
Find File names with sustitution baanprog UNIX for Advanced & Expert Users 4 09-26-2007 04:51 AM
mv command and file-timestamps gian1975 UNIX for Advanced & Expert Users 1 07-04-2006 10:01 AM
how to find capital letter names in a file without finding words at start of sentence kev269 Shell Programming and Scripting 1 04-10-2006 09:35 PM
Find command to get the timestamps nguda Shell Programming and Scripting 8 03-24-2003 12:35 PM

Closed Thread
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 08-31-2004
thanuman thanuman is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 24
Lightbulb find command not giving file names accord. to timestamps

Currently iam working on solaris environment,
Iam using find command to get list of all files between any two given dates. But the find command is not listing files accord. to timestamp. I tried using -exec option as -exec ls -ltr {} \;
Still the files are not listed according to timestamp..
Can anyone help me on this..

find . -type f -name '*xyz*' -newer start.file ! -newer end.file
-exec ls -ltr {} \;
  #2 (permalink)  
Old 08-31-2004
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,407
Try using...

find . -type f -name '*xyz*' -newer start.file ! -newer end.file -exec ls -ltr {} \+

Or...

find . -type f -name '*xyz*' -newer start.file ! -newer end.file -print | xargs ls -ltr

However, neither method is guaranteed to work for large numbers of matched files.
  #3 (permalink)  
Old 08-31-2004
thanuman thanuman is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 24
I have 200 or more files , I already tried -exec ls -ltr {} \; option, but it didn't work...
  #4 (permalink)  
Old 08-31-2004
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,407
The -exec ls -ltr {} \; option invokes the ls command for each matched file. Try one of the two suggestions above.
  #5 (permalink)  
Old 09-02-2004
moxxx68's Avatar
moxxx68 moxxx68 is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 301
Question could work!?

try !
find . -type f - ctime or (mtime) depending on what you're looking for ..
find . -type f - ctime +20 -name "*" -exec ls -alt {} \;
find . -type f -mtime -30 -name "*" -exec ls -alt {} \;
i believe there is also an atime.. (man find should tell which choice to make)..
moxxx68
  #6 (permalink)  
Old 09-03-2004
thanuman thanuman is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 24
find . -type f -name '*xyz*' -newer start.file ! -newer end.file -exec ls -ltr {} \+
The above cmd is not giving files accord. to timestamp , so doesn't give required o/p

find . -type f -name '*xyz*' -newer start.file ! -newer end.file -print | xargs ls -ltr

The above cmd is giving files accord. to timestamp , this is working as required...

Also the below cmd is working.......
ls -ltr `find . -type f -name '*xyz*' -newer start.file ! -newer end.file -print `

Thanks for your inputs...
  #7 (permalink)  
Old 09-07-2004
thanuman thanuman is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 24
I want to get all the files between start.file and end.file in the current directory only (not files in the sub directories).

find . -type f -name '*xyz*' -newer start.file ! -newer end.file -print

With the above command , Iam getting files in subdirectories of the current directory also... How to avoid this.. Can someone help us...
Sponsored Links
Closed Thread

Bookmarks

Tags
mtime

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