- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HP-UX 10.20 finding pattern.!!
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
08-02-2004 07:08 PM
08-02-2004 07:08 PM
How do i do recursive grep , for a pattern in HP-UX 10.20 .
I want to search the string "80.0.0.10" in all the files from root.
Please help me .
Raj. D
-------
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2004 07:15 PM
08-02-2004 07:15 PM
Re: HP-UX 10.20 finding pattern.!!
find / -type f -exec grep -l "80.0.0.10" {} \;
but be aware of high system load.
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2004 07:34 PM
08-02-2004 07:34 PM
Re: HP-UX 10.20 finding pattern.!!
simply type
cd /
for i in `ls`
do
grep -l '80.0.0.10' $i
done
Simple and fast :-)
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2004 07:49 PM
08-02-2004 07:49 PM
Re: HP-UX 10.20 finding pattern.!!
I suggest to use find and define/specify name of files. Otherwise it will take too long time to look inside all files. It is usuallu ascii/conf files.
find / -name "file*.*" -type f -exec grep -l "80.0.0.10" {} \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2004 08:08 PM
08-02-2004 08:08 PM
Re: HP-UX 10.20 finding pattern.!!
grep '90.0.0.10' `find
If you are going to search in all files, there will be some problem.
grep will make problem on searching a patter in an object executable files.
It is good to use some extensions of a file.
Example:
grep '80.0.0.10' `find . -name "*.log"`
./test.log:80.0.0.10
-- muthu --
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2004 08:16 PM
08-02-2004 08:16 PM
Re: HP-UX 10.20 finding pattern.!!
my proposal is fast if it's in the straight line - otherwise you'll have to use the `ls -R` option which takes longer time.
If you want to use the "find" - option then you can limit the search through the use of "-xdev" (without crossing mount points) which would speed up the search
find / -xdev -type f -exec ...
Franky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2004 09:06 PM
08-02-2004 09:06 PM
Re: HP-UX 10.20 finding pattern.!!
Well it is taking lond time , is there any way to find out the string "80.0.0.10" , for ASCII files only.
i wanted to know which files in oracle is using the IP address , or hostname .
ASCII file searching only would be a good options. And feedback will be appreciated.
Raj .D
-------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2004 11:35 PM