Operating System - HP-UX
1836444 Members
2407 Online
110100 Solutions
New Discussion

Find all the files related to every single filesystem from Nov 08

 
Kennedy G. Doss
Regular Advisor

Find all the files related to every single filesystem from Nov 08

HP-UX SAs:

How do I list all the files which were modified since Nov 1st 2008. I want the listing from all the filesystems/directories. I tried these two commands from an old message in this forum but I get only a partial result.

#touch -mt 200812060000 myref #find / * -xdev -newer /var/adm/ressspkp/myref -exec ll {} \;

Any input from you would be most appreciated.

Regards,
KGD.
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Find all the files related to every single filesystem from Nov 08

Hi:

# touch -amt 200811010000 /tmp/myref
# find / -xdev -type f -newer /tmp/myref -exec ls -l {} +

Your principal problem is that you found BOTH files and directories by not specifying the '-type f'. Then your 'll' applied to both files AND directories.

Note too, that it is much, much faster to terminate the '-exec' argument with a "+" instead of "\;".

Regards!

...JRF...
Jozef_Novak
Respected Contributor

Re: Find all the files related to every single filesystem from Nov 08

Hi Kennedy,

try:

# find / -type f -mtime -110 -exec ll {} \;

J.
Dennis Handly
Acclaimed Contributor

Re: Find all the files related to every single filesystem from Nov 08

>JRF: you found BOTH files and directories by not specifying the '-type f'. Then your 'll' applied to both files AND directories.

If you also want to find directories, you need to use "ll -d".
Kennedy G. Doss
Regular Advisor

Re: Find all the files related to every single filesystem from Nov 08

All the three resolutions worked. Something which I had never heard was was the +a method of terminating the -exec. That was a cool tip. Thanks to all those who replied so quickly.