Oracle Solaris System Administration (MOSC)

MOSC Banner

How to exclude directories from search?

edited Mar 14, 2014 12:21PM in Oracle Solaris System Administration (MOSC) 10 commentsAnswered ✓

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.

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center