Solved

Using Find

Posted on 1998-10-02
6
148 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
Comment Utility
Edited text of question
0
 
LVL 10

Accepted Solution

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

Expert Comment

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

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 5

Expert Comment

by:ecw
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

762 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

6 Experts available now in Live!

Get 1:1 Help Now