|
Home > Archive > Unix administration > October 2004 > find files in a absolute directory but not include 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 absolute directory but not include subdirectory.
|
|
| bluebirdken 2004-10-26, 5:51 pm |
| I would like to find files in a given directory which over 2 days not
modify by anyone. I use the find command, but I find that the result
include all other subdirectory under the given directory. I want the
result only in the given directory, but not include the subdirectory
under it. for example
the given directory is /etc/ , I only want to find the files in /etc/
but not /etc/bin/ or /etc/log or other. How can I do that, can
someone give me help please?
| |
| Stephane CHAZELAS 2004-10-26, 5:51 pm |
| 2004-10-26, 07:26(-07), bluebirdken:
> I would like to find files in a given directory which over 2 days not
> modify by anyone. I use the find command, but I find that the result
> include all other subdirectory under the given directory. I want the
> result only in the given directory, but not include the subdirectory
> under it. for example
> the given directory is /etc/ , I only want to find the files in /etc/
> but not /etc/bin/ or /etc/log or other. How can I do that, can
> someone give me help please?
find /etc/. \( -name . -o -prune \) ...
With zsh:
print -rl /etc/*(m+2)
--
Stephane
|
|
|
|
|