Solved

Using Find

Posted on 1998-10-02
6
157 Views
Last Modified: 2013-12-06
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)?
0
Comment
Question by:jsembhi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:jsembhi
ID: 2007170
Edited text of question
0
 
LVL 10

Accepted Solution

by:
rbr earned 10 total points
ID: 2007171
use find . -name "*partialname*" -print
0
 
LVL 10

Expert Comment

by:rbr
ID: 2007172
You must be in the root path if you want to search all your HD.
cd /

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ecw
ID: 2007173
HP-UX is posixified, so you don't need -print, so this'll work too:
  find / -name '*partialname*'
0
 
LVL 1

Expert Comment

by:plebras
ID: 2007174
The exact command is  (to avoid pipe files which block the search)
cd /
find . -type f -name 'thenameof file" -print
0
 

Expert Comment

by:nfrances
ID: 2007175
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question