swasid
1
Hi,
I have two files under two separate directories as in:
find . -name test.sh
./test.sh
./abc/test.sh
I want my find to only look for the file test.sh
that is under the current directory and not one under /abc
How do I use prune to achieve this? I am on AIX
What have you tried so far with the prune flag?
Robin
I think you want to check out -level 0 option
Try:
find . \( ! -name . -prune \) -name test.sh
but:
ls test.sh 2>/dev/null
or
[ -e test.sh ] && echo test.sh
would be easier and the last one would be a LOT faster.