- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find a word in the system
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-10-2003 05:09 PM
10-10-2003 05:09 PM
# grep -i "hello" , it will only find the files in the specific system but not to each subdirectories , can suggest what can i do ? thx.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2003 06:06 PM
10-10-2003 06:06 PM
Re: find a word in the system
I want to find the files that contains the word "hello" in my whole system ( include all sub-directories) , can suggest what can i do ? thx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2003 06:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2003 07:36 PM
10-10-2003 07:36 PM
Re: find a word in the system
Use the find option with..
find / -type f -exec grep -i hello {} \;
the left hand will list the files that have word hello.
Or redirect this to a fine and grep the first word like
awk -F ":" '{print &1}'
cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2003 02:33 AM
10-12-2003 02:33 AM
Re: find a word in the system
# cd
# find . -type f -exec grep -i {} \;
(where = path_of_whole_system and = word_by_search)
HTH
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2003 03:55 AM
10-12-2003 03:55 AM
Re: find a word in the system
find / -type f | xargs grep -i hello
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2003 04:01 PM
10-12-2003 04:01 PM
Re: find a word in the system
find . -type f -exec grep -i "hello" {} \; -print 2>/dev/null
-print option is needed so that the file name in which the character is found is also printed.
In grep, include the -i option if you want to ignore case... Hello, hEllo and so on will also be searched for. If you want only hello then just give
cd /
find . -type f -exec grep "hello" {} \; -print 2>/dev/null
if your are not the root user, you will not have search permission on many dirs and hence will see lots of permission denied errors and so redirect the error 2>/dev/null will give you a clean output