- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how do you search for a file?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 03:06 AM
10-01-2003 03:06 AM
how do you search for a file?
for example's sake lets say the file is called cheesychips
also if I did know which directory whats the correct command then?
cheers for any help
bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 03:09 AM
10-01-2003 03:09 AM
Re: how do you search for a file?
If you have an idea what filesystem its on, say opt, you can go.
find /opt -name cheesychips
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 03:09 AM
10-01-2003 03:09 AM
Re: how do you search for a file?
find / -name cheesychips
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 03:10 AM
10-01-2003 03:10 AM
Re: how do you search for a file?
Regards,
Sergejs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 03:11 AM
10-01-2003 03:11 AM
Re: how do you search for a file?
You can replace cheesychips with "*chips" or "ch*s*ch*" to get all files that match that pattern.
Now if using a pattern instead of a whole file name I surround it with quotes (as above) but some people don't. I do because I have no idea how the shell can possibly not expand that before running the command and therefore don't believe it really does work if you don't put quotes around it (evidence to the contrary)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 03:11 AM
10-01-2003 03:11 AM
Re: how do you search for a file?
# find / -name cheesychips -type f
The above will look through the entire system for a file (-type f) of name cheesychips.
# find /dir -name cheesychips -type f
The above will look through the specified dir for the file named cheesychips.
There are numerous options to find. Do a 'man find' for more info.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 06:05 AM
10-01-2003 06:05 AM
Re: how do you search for a file?
find / -name cheesychips -type f -print
or
cd /
find . -name cheesychips -print
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 06:07 AM
10-01-2003 06:07 AM
Re: how do you search for a file?
Will search the entire dir structure for this file
-GK-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 06:19 AM
10-01-2003 06:19 AM
Re: how do you search for a file?
more system load, but easier syntax than find.
find / -print | grep heesy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2003 09:29 AM
10-01-2003 09:29 AM
Re: how do you search for a file?
fc -l 1 | grep cd
fc -l 1 | grep lostfilename
BTW: if you don't have a hitory file, turn this on immediately to avoid similar situations. In /etc/profile, add these two lines:
export HISTFILE=$HOME/.sh_history
export HISTSIZE=500
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 01:14 AM
10-02-2003 01:14 AM
Re: how do you search for a file?
The option "-user" bound the command "find" can be used ... example: I want to find all the file-names that they begin with "chee" and that they belong to the user "bruno".
find / -name chee* -user bruno -print
Bruno