I am new bee for Linux. I have a question about the command find
. When I search a file under a directory, I would like to skip a sub-directory named publish
find ./ -path ./publish -prune -o -iname rdesvc -type f -print
It works fine:
./release/apps/rdeSvc/server/linux/rdeSvc
But, if I remove the parameter -print
:
find ./ -path ./publish -prune -o -iname rdesvc -type f
It will output the sub-directory name with the search result:
./publish
./release/apps/rdeSvc/server/linux/rdeSvc
I feel confusion. Why the sub-directory name publish
is outputted if I removed the parameter -print
?
My distribution is CentOS 6.6 64 bit.