- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unix Grep
Operating System - HP-UX
1752720
Members
5663
Online
108789
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
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
тАО01-10-2005 04:58 AM
тАО01-10-2005 04:58 AM
Re: Unix Grep
Hi,
I'm not sure which file would have the string which i'm searching for. Hence i'm planning to start the search from my home directory.
Thats why i couldnt "Limit to set of directory"
How can limit to set of directory ?
Thanks
Jil
I'm not sure which file would have the string which i'm searching for. Hence i'm planning to start the search from my home directory.
Thats why i couldnt "Limit to set of directory"
How can limit to set of directory ?
Thanks
Jil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2005 05:04 AM
тАО01-10-2005 05:04 AM
Re: Unix Grep
find /dir1 /dir2 /dir3/xxx -type f ...
This will sequentially search /dir1 (and all subdirectories) then /dir2 (abd subdirectories) then /dir3/xxx and so on.
Man find for details.
If you are unsure, then you can simply find / but be aware of the load you are imposing on the system.
This will sequentially search /dir1 (and all subdirectories) then /dir2 (abd subdirectories) then /dir3/xxx and so on.
Man find for details.
If you are unsure, then you can simply find / but be aware of the load you are imposing on the system.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2005 03:56 AM
тАО01-11-2005 03:56 AM
Re: Unix Grep
jilpangs,
I use something similar to this when I'm looking for a text string in a list of directories. You obviously need the correct search/read permissions to do this:
find . -follow -type f \( -name '*.sql' -o -name '*.sh' -o -name '*.log' \) -exec grep -il '' {} \; 2>/dev/nu
find
. :from this direction
-follow :follow all symbolic links
-type f :find only regular files
\( -name ... -o \) :matching an OR of these regular expressions
-exec :execute the following command
grep -il '' :grep all find results for regular expression, ignore case and print filenames to stdout
2>/dev/null :stderr to /dev/null
You can place this is a 'for' loop to execute more commands on the resulting files.
Regards,
PK
I use something similar to this when I'm looking for a text string in a list of directories. You obviously need the correct search/read permissions to do this:
find . -follow -type f \( -name '*.sql' -o -name '*.sh' -o -name '*.log' \) -exec grep -il '
find
. :from this direction
-follow :follow all symbolic links
-type f :find only regular files
\( -name ... -o \) :matching an OR of these regular expressions
-exec :execute the following command
grep -il '
2>/dev/null :stderr to /dev/null
You can place this is a 'for' loop to execute more commands on the resulting files.
Regards,
PK
It's nice to be important but it's more important to be nice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2005 04:56 AM
тАО01-11-2005 04:56 AM
Re: Unix Grep
Do you need to 'see' the matches, or just know which files might match. Fo rthe latter:
find . -type f \( -name '*.sql' -o -name '*.sh' -o -name '*.log' \) -exec grep -l "ADFH Script Failed" {} \;
Hein.
- « Previous
-
- 1
- 2
- Next »
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