Using Find

I have tried using find to search for a file, but am probably using the wrong commands. How do I find a file, for which I  have a partial name and I do not know its location (using HP-UX)?
jsembhiAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
rbrConnect With a Mentor Commented:
use find . -name "*partialname*" -print
0
 
jsembhiAuthor Commented:
Edited text of question
0
 
rbrCommented:
You must be in the root path if you want to search all your HD.
cd /

0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
ecwCommented:
HP-UX is posixified, so you don't need -print, so this'll work too:
  find / -name '*partialname*'
0
 
plebrasCommented:
The exact command is  (to avoid pipe files which block the search)
cd /
find . -type f -name 'thenameof file" -print
0
 
nfrancesCommented:
the second parameter is where to start searching (hence they say to go to the root directory and use a "." as the second parm)...  you could just as easily specify the directory path in this parm.

The more important point is how to get rid of the flurry of error messages that you will get from "find: cannot open ..."   To move them safely away from your terminal, use:

find . -name '*name*' -print 2>/dev/null

which redirects standard error to /dev/null (blackhole).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.