|
|
find files between date x and date y
I need to search for all files accessed between Midnight and 12:30AM
within a set of directories and list the information in an ls -l
format.
How can I do something like that? I know how to find file newer than X
or older than Y, but I can't get both these commands to work together
and produce some meaningful output.
Anyone have any ideas?
Thanks!
A.
|
|
0
|
|
|
|
Reply
|
alistair.calder (5)
|
4/13/2006 2:31:43 AM |
|
alistair wrote:
> I need to search for all files accessed between Midnight and 12:30AM
> within a set of directories and list the information in an ls -l
> format.
>
> How can I do something like that? I know how to find file newer than X
> or older than Y, but I can't get both these commands to work together
> and produce some meaningful output.
>
> Anyone have any ideas?
>
> Thanks!
> A.
>
Touch 2 files, start_date and stop_date, like this:
$ touch -t 200603290000.00 start_date
$ touch -t 200603290030.00 stop_date
Ok, start_date is 03/29/06 midnight, stop_date is 03/29/06 30 minutes
after midnight. You might want to do a ls -al to check.
On to find, you can find -newer and then ! -newer, like this:
$ find /dir -newer start_date ! -newer stop_date -print
Combine that with ls -l, you get:
$ find /dir -newer start_date ! -newer stop_date -print0 | xargs -0 ls -l
(Or you can try -exec to execute ls -l. I am not sure of the format, so
you have to muck around a little bit)
HTH
|
|
-2
|
|
|
|
Reply
|
Anonymous
|
4/13/2006 3:24:57 AM
|
|
Anonymous <anonymous@iscdemo.net> wrote:
> Combine that with ls -l, you get:
> $ find /dir -newer start_date ! -newer stop_date -print0 | xargs -0 ls -l
find -print0 and xargs -0 are nonstandard (and won't work in Solaris).
If -print is not sufficient, you can use "-ls" (nonstandard, but works in
Solaris) or "-exec ls -l {} +" instead.
From the SUSv3:
A feature of SVR4's find utility was the -exec primary's + terminator. This
allowed filenames containing special characters (especially <newline>s) to
be grouped together without the problems that occur if such filenames are
piped to xargs. Other implementations have added other ways to get around
this problem, notably a -print0 primary that wrote filenames with a null
byte terminator. This was considered here, but not adopted. Using a null
terminator meant that any utility that was going to process find's -print0
output had to add a new option to parse the null terminators it would now
be reading.
--
Daniel
|
|
0
|
|
|
|
Reply
|
Daniel
|
4/13/2006 4:04:19 AM
|
|
|
2 Replies
3058 Views
(page loaded in 0.066 seconds)
Similiar Articles: find files between date x and date y - comp.unix.solaris ...I need to search for all files accessed between Midnight and 12:30AM within a set of directories and list the information in an ls -l format. How can... Using awk to find a range of dates - comp.lang.awkI have a directory full of text files which all include a line like: date: July 14, 2002 Is it possible to find the files for which this line matche... Re: Subsetting data based on date range - comp.soft-sys.sas ...find files between date x and date y - comp.unix.solaris ... Re: Subsetting data based on date range - comp.soft-sys.sas ..... from one x, two y where x.id = y.id and y ... find y of x - comp.soft-sys.matlabfind files between date x and date y - comp.unix.solaris ... I need to search for all files accessed between Midnight and 12:30AM within a set of directories and list the ... List All Files in Directory Within a Range of Date - comp.sys.sun ...Hi, Is there a way to list all of the files in a directory within a range of date or just a specific date? Any helps are appreciated. TIA, -Chris ... calculate day, hour , sec between dates - comp.lang.java ...find files between date x and date y - comp.unix.solaris ... 1726 ... comp.unix ... find files between date x and ... Hi all, I am trying to find the days between two dates ... Cant get "grant execute on procedure" to work. - comp.databases ...find files between date x and date y - comp.unix.solaris ..... newer than X or older than Y, but I can't get both these commands to work ... ls -l (Or you can try -exec ... Computer Groupfind files between date x and date y 2 1717 (4/13/2006 2:31:43 AM) comp.unix.solaris I need to search for all files accessed between Midnight and 12:30AM within a set of ... Finding common lines between text files - comp.unix.programmer ...find files between date x and date y - comp.unix.solaris ..... file with timestamp 6 hours back - comp.unix.solaris ... find files between ... range of dates - comp.lang ... How to get a 180days back date - comp.unix.solarisHi, Stuck in the middle: as I have to calculate the date back to 180days and remove the files for a particular directory. So, please help me in this... Solaris Operating System: find files between date x and date y ...software.itags.org: Solaris Operating System question: find files between date x and date y, created at:Fri, 23 May 2008 16:00:00 GMT with 393 bytes, last updated ... find files between date x and date y - comp.unix.solaris ...I need to search for all files accessed between Midnight and 12:30AM within a set of directories and list the information in an ls -l format. How can... 7/20/2012 11:55:19 AM
|
|
|
|
|
|
|
|
|