- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to search strings in multiple files recursivel...
Operating System - HP-UX
1758532
Members
2108
Online
108872
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО02-27-2008 11:59 PM
тАО02-27-2008 11:59 PM
Hi all
I'm not good at shell programming
I know that if you want to search one string within a directory ,you can run "grep *" to complete.
But if there is a sub directory and you also want to search,how can you do this job recursively.
What if there is another sub directory in that sub directory?
Tks in advance
I'm not good at shell programming
I know that if you want to search one string within a directory ,you can run "grep
But if there is a sub directory and you also want to search,how can you do this job recursively.
What if there is another sub directory in that sub directory?
Tks in advance
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2008 12:19 AM
тАО02-28-2008 12:19 AM
Solution
Many ways to achieve this.
One is mentioned in the find man page:
Search the two directories /example and /new/example for files containing the string Where are you and print the names of the files:
find /example /new/example -exec grep -l 'Where are you' {} \;
http://docs.hp.com/en/B2355-60103/find.1.html
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
One is mentioned in the find man page:
Search the two directories /example and /new/example for files containing the string Where are you and print the names of the files:
find /example /new/example -exec grep -l 'Where are you' {} \;
http://docs.hp.com/en/B2355-60103/find.1.html
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2008 12:34 AM
тАО02-28-2008 12:34 AM
Re: how to search strings in multiple files recursively
>Torsten: One is mentioned in the find man page:
For performance a "+" should be used instead:
find /example -exec grep -l 'Where are you' {} +
For performance a "+" should be used instead:
find /example -exec grep -l 'Where are you' {} +
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2008 12:57 AM
тАО02-28-2008 12:57 AM
Re: how to search strings in multiple files recursively
Thank you guys
It absolutely helped!
It absolutely helped!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP