- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: find a string
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
01-05-2003 08:11 PM
01-05-2003 08:11 PM
eg. I would like to know which file(s) in the system contains the word ???Full??? , what can i do?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2003 08:20 PM
01-05-2003 08:20 PM
Re: find a string
This command will search the contents of every file in the system for the word in the single quotes.
the / can be a subdirectory to save time.
find command is very CPU/load intensive. Use with care.
Steve
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
01-06-2003 12:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2003 01:07 AM
01-06-2003 01:07 AM
Re: find a string
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2003 01:19 AM
01-06-2003 01:19 AM
Re: find a string
if you do a 'find /', i might be wise to include a '-xdev', so it only searches your '/'. In this way you can search each fs at a time, and avoid overkill.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2003 02:56 AM
01-06-2003 02:56 AM
Re: find a string
1. Never do this over NFS (unless you've got loads of spare time for `active waiting')
2. find / -exec grep 'string' /dev/null {}\;
is good, but
find / -type f -exec grep 'string' /dev/null {}\;
is better (think pipes)
3. GNU grep (available on https://www.beepz.com/personal/merijn/ or http://www.cmve.net/~merijn/) can do recursive greps
grep -r 'pattern' /
which is much faster and uses less system resources
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2003 02:59 AM
01-06-2003 02:59 AM
Re: find a string
You may want to exclude binary files, so you could do something like this:
find / -type f | xargs file | grep -v " shared " | cut -d: -f 1|xargs grep "string to find" /dev/null
Rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2003 07:11 PM
01-07-2003 07:11 PM
Re: find a string
I think u can find out each file(even each row in the file) in the system which contains the word(string) u specified by following command:
find / -type f | xargs grep "Full"
Good lucky!
Tang qiang
08/01/03