|
Home > Archive > Unix administration > October 2004 > find files in a given directory, but exclude all other subdirectory.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
find files in a given directory, but exclude all other subdirectory.
|
|
| bluebirdken 2004-10-29, 7:48 am |
| I would like use the find command to find files which without modifiy
over 3 days, but I only need the result in a given directory(for
example /etc/), I don't want the result for all other subdirectory
under /etc (for example /etc/bin/ or /etc/logs) , I mean to exclude
all subdirectory under the given direcotry, how can I do that ?
Would someone give me a help, thank you.
| |
| Barry Margolin 2004-10-29, 8:47 pm |
| In article <993d37de.0410290457.6109d808@posting.google.com>,
ken.fong@hkcg.com (bluebirdken) wrote:
> I would like use the find command to find files which without modifiy
> over 3 days, but I only need the result in a given directory(for
> example /etc/), I don't want the result for all other subdirectory
> under /etc (for example /etc/bin/ or /etc/logs) , I mean to exclude
> all subdirectory under the given direcotry, how can I do that ?
> Would someone give me a help, thank you.
If you have GNU find, you can use its -maxdepth option to prevent if
from drilling down. With traditional find, you can do:
find <dir>/* <dir>/.* -type d -prune -o -mtime -3 print
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
|
|
|
|
|