Solved

Using Find

Posted on 1998-10-02
6
149 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
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
prtdiag report hdd failure 10 140
Best way to handle awk return value 6 66
change HISTFILE for root user on AIX 3 71
FTP on FreeBSD server 2 115
Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

864 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now