Operating System - Linux
1754354 Members
4737 Online
108813 Solutions
New Discussion юеВ

FIND in specific directory

 
SOLVED
Go to solution
Vadim Loginov
Advisor

FIND in specific directory

Hi,

I have got a directory: /home/aa/
There are some subdirectories in it:
/home/aa/a
/home/aa/b
/home/aa/..

I want to find all files in /home/aa/ older then 10 day

When I run: | find /home/aa/ -type f -mtime +10 | I have got output with data from subdirectories.
Are there any ways to run this search only in /home/aa/ directory?

Cheers

Vadim
7 REPLIES 7
Peter Godron
Honored Contributor
Solution

Re: FIND in specific directory

Hi,
cd /home/aa
find . -type f -mtime +10 ! -path "./*/*"

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.

So far you have not awarded any points !
Steven E. Protter
Exalted Contributor

Re: FIND in specific directory

Shalom,

try the -depth parameter.

Don't have any Unix boxes on in my house but the paramter is available on linux and may be worth a look.

There are online man pages for HP-UX at http://docs.hp.com

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pete Randall
Outstanding Contributor

Re: FIND in specific directory

That's exactly what I was thinking, Steve, so I tried it. I also tried -prune, -follow, and -only. None of them worked as expected. Now I'm confused.


Pete

Pete
Oviwan
Honored Contributor

Re: FIND in specific directory

Hey

Check this thread with similar question:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1084860

Regards
Peter Godron
Honored Contributor

Re: FIND in specific directory

Hi,
could I draw your attention to:

http://66.34.90.71/ITRCForumsEtiquette/after.html

After having read this, you may want to use
http://forums1.itrc.hp.com/service/forums/helptips.do?#41

to re-open your threads to award points.

Your earlier threads are:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1108742
Vadim Loginov
Advisor

Re: FIND in specific directory

Hi Peter,

To be honest I have assigned some points to everyone for this and for my previous thread. But now I see that status is still ├в unassigned├в .
I am gonna fix it very soon.

Cheers

Regards,

Vadim
Vadim Loginov
Advisor

Re: FIND in specific directory

closed!!!