Operating System - HP-UX
1826312 Members
4357 Online
109692 Solutions
New Discussion

syntax for using find command

 
SOLVED
Go to solution
Mark Harshman_1
Regular Advisor

syntax for using find command

hello
i am trying to use the find command to list all files in a large directory that are older then 90 days, and then dump the list to a file. I seem to not be able to get the syntax correct. Help would be appreciated. HPUX11.i. thanks
Never underestimate the power of stupid people in large groups
11 REPLIES 11
Patrick Wallek
Honored Contributor

Re: syntax for using find command

# cd /dir
# find . -type f -mtime +90 -print > list_of_old_files

Robert-Jan Goossens
Honored Contributor

Re: syntax for using find command

Hi,

# find /directory -type f -mtime +90 -exec ll \; >> /tmp/directory.log

Regards,
Robert-Jan
john korterman
Honored Contributor

Re: syntax for using find command

find -type f -mtime +90 > /tmp/yt 2>&1

will make the list to /tmp/yt

regards,
John K.
it would be nice if you always got a second chance
TwoProc
Honored Contributor

Re: syntax for using find command

cd /target_dir
find . -type f -mtime +90 > old_file_listing
or
find /target_dir -type f -mtime +90 > old_file_listing
We are the people our parents warned us about --Jimmy Buffett
Mark Harshman_1
Regular Advisor

Re: syntax for using find command

thanks..im sure these will work..
Never underestimate the power of stupid people in large groups
Mark Harshman_1
Regular Advisor

Re: syntax for using find command

ok, these work..but none give me the long list of files to the log file. Any other ideas?
Never underestimate the power of stupid people in large groups
MarkSyder
Honored Contributor

Re: syntax for using find command

I would have expected Robert Jan's suggestion to provide a long listing. Have you tried replacing the ll with ls -l?

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Robert-Jan Goossens
Honored Contributor
Solution

Re: syntax for using find command

ahhhhhh stupid me, sorry I made a mistake.

# find /directory -type f -mtime +90 -exec ll {} \; >> /tmp/directory.log
Patrick Wallek
Honored Contributor

Re: syntax for using find command



# cd /dir
# find . -type f -mtime +90 -exec ls -l {} \; > list_of_old_files
Henk Geurts
Esteemed Contributor

Re: syntax for using find command

i suggest you use Robert Jan's suggestion with a minor adjustment:
find /directory -type f -mtime +90 -exec ll {} \; >> /tmp/directory.log
note the {}
regards.
Mark Harshman_1
Regular Advisor

Re: syntax for using find command

Thanks Robert...that did the trick.
Never underestimate the power of stupid people in large groups