Go Back   The UNIX and Linux Forums > Operating Systems > Solaris
Search Forums:



Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-15-2006
Registered User
 

Join Date: Mar 2006
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation List files with a specific date...

Hi all,

thanks in advance for reading and anyposts...

I was wondering if its possible to find all files in a directory with a specific date.

I know I can do:

Quote:
find [path] -mtime [int]
but that will only give a list of files greater than todays date... Any ideas?

Thanks,

Marky Mark...
Sponsored Links
    #2  
Old 06-15-2006
reborg's Avatar
reborg reborg is offline Forum Advisor  
Administrator Emeritus
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,466
Thanks: 0
Thanked 6 Times in 6 Posts
try this thread it is working with two dates which is more than you want, but you should eb able to figure out the changes needed.
Sponsored Links
    #3  
Old 06-15-2006
Registered User
 

Join Date: Mar 2006
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb

Thanks that looks useful, I post what I come up with once I have got it finished...
    #4  
Old 06-15-2006
Registered User
 

Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
what you can do is
ls -ltr |grep 'Jun 15' (for todays files) take care of the extra space when using 1 digit

ls -ltr |grep 'Jun 1'
Sponsored Links
    #5  
Old 06-15-2006
Registered User
 

Join Date: Mar 2006
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Lightbulb

Ok I am going to have to get it to execute some commands after, but this is what my script will look like:

Quote:
#!/bin/sh

olddate="200606132359"

newdate="200606150000"

touch -t $olddate ./tmpoldfile
touch -t $newdate ./tmpnewfile

find /u02/oracle/titandata/ -type f -newer ./tmpoldfile ! -newer ./tmpnewfile -ls
eventually I intend to use the -exec rm{} \; command at the end of the statment. Essentially this will enable me to get rid of file which reside in a specific time frame....

...thanks for all your help...

B14... aka.... marky mark...
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find files with specific date and time itik AIX 3 01-18-2008 12:21 PM
How to list files with specific created date Draculla Filesystems, Disks and Memory 2 05-03-2007 11:45 PM
List files created between specific date and time jazjit Shell Programming and Scripting 3 04-27-2007 01:19 AM
List all files that contain a specific directory Sat510 Solaris 7 04-17-2007 10:57 AM
List specific files from directories Filippo Shell Programming and Scripting 4 02-17-2005 02:56 AM



All times are GMT -4. The time now is 05:58 AM.