Re: Find files in current directory excluding sub-directories




lovecreatesbea...@xxxxxxxxx wrote:
I use following two methods to find files in a directory but not its
sub-directories on HP-UX B.11.11.

$ find /home/jhl -type f ! -path './*/*' -name "*.c"
$ find /home/jhl -type f -prune -name "*.c"

But both present me with files in sub-directories.

Can you teach me how to find files in current directory only? Thank you.

Hi,

Try the following:
$ find /home/jhl -path "/home/jhl/*" -prune -name "*.c"

Jon

.