How to exclude directories from search?
Hello,
I'm trying to wright a script that searches for java on my servers. I'm using the find command and this is what I am using right now.
sudo find / -name java -type f 2>/dev/null | egrep -v '(10_Recommended | share)'
What I would like to do, is shorten the search the find command does by excluding the directories. How can I do this? I have tried using the -prune option but I could not get it to work.
Any help would be great.