Operating System - HP-UX
1752618 Members
4297 Online
108788 Solutions
New Discussion юеВ

Re: list all files in the system which had a particular date

 
SOLVED
Go to solution
MSwift
Regular Advisor

list all files in the system which had a particular date

I want to list all the files in the system which has the timestamp of May 17 on it. since it is the current year i am not worried about the year stamp. How would i do this?

Thanks

Mike
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: list all files in the system which had a particular date

Hi Mike:

One way:

# touch -amt 05162359.59 /tmp/ref1
# touch -amt 05172359.59 /tmp/ref2

# find / -type f -newer /tmp/ref1 -a ! -newer /tmp/ref2 -exec ls -ld {} +

Regards!

...JRF...

MSwift
Regular Advisor

Re: list all files in the system which had a particular date

Thanks Jrf

But this hogs the cpu on my nclass server with 8 cpu's and it still hangs, should i wrtite it some file?

Thx

Mike
James R. Ferguson
Acclaimed Contributor
Solution

Re: list all files in the system which had a particular date

Hi Mike:

> But this hogs the cpu on my nclass server with 8 cpu's and it still hangs, should i wrtite it some file?

Well of course it spins the processors! You ased for "all the files in the system" so we need to recursively search _everything_. Then for each file or directory 'find()' sees it must 'stat()' the entity and compare the 'mtime' to the reference values. This _does_ take some time.

Yes, I would redirect the output to a file and go get some coffee.

# find / -type f -newer /tmp/ref1 -a ! -newer /tmp/ref2 -exec ls -ld {} + > /tmp/files_for_may17

Regards!

...JRF...