- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: I would like to find the name "XXDBD_OKS_PRICI...
Operating System - HP-UX
1752701
Members
5748
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
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
тАО06-26-2008 12:58 AM
тАО06-26-2008 12:58 AM
Hi,
I would like to grep for the name "XXDBD_OKS_PRICING_VALUES" under all the files in a directory. Please let me know the command to use.
There are about 332 files under a directory. My requirement is to cat each file and check if it have "XXDBD_OKS_PRICING_VALUES" mentioned in the file.
Thanks in Advance.
SP
I would like to grep for the name "XXDBD_OKS_PRICING_VALUES" under all the files in a directory. Please let me know the command to use.
There are about 332 files under a directory. My requirement is to cat each file and check if it have "XXDBD_OKS_PRICING_VALUES" mentioned in the file.
Thanks in Advance.
SP
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2008 01:30 AM
тАО06-26-2008 01:30 AM
Solution
There are many ways to accomplish this.
The basic method:
cd directory
grep "XXDBD_OKS_PRICING_VALUES" *
If the above causes an "Arg list too long" or "Command line too long" error message (which might happen if you have tens of thousands of files in the directory, or if the files have _really_ long names), you'll need to use a more advanced method, for example:
cd directory
find . -type f -exec grep "XXDBD_OKS_PRICING_VALUES" {} \+
This method can handle large numbers of files, any special characters in the filenames, etc.
By default, the find command will examine the sub-directories of the chosen directory too. If you don't want that, you might use the -path option of the find command to restrict the search to the current directory.
MK
The basic method:
cd directory
grep "XXDBD_OKS_PRICING_VALUES" *
If the above causes an "Arg list too long" or "Command line too long" error message (which might happen if you have tens of thousands of files in the directory, or if the files have _really_ long names), you'll need to use a more advanced method, for example:
cd directory
find . -type f -exec grep "XXDBD_OKS_PRICING_VALUES" {} \+
This method can handle large numbers of files, any special characters in the filenames, etc.
By default, the find command will examine the sub-directories of the chosen directory too. If you don't want that, you might use the -path option of the find command to restrict the search to the current directory.
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2008 01:38 AM
тАО06-26-2008 01:38 AM
Re: I would like to find the name "XXDBD_OKS_PRICING_VALUES" in all the files under a directory
Hi,
find . -type f -print |xargs grep XXDBD_OKS_PRICING_VALUES.
i also looked at grep with -R parameter, but doesn't exits in hp-ux.
Kenan.
find . -type f -print |xargs grep XXDBD_OKS_PRICING_VALUES.
i also looked at grep with -R parameter, but doesn't exits in hp-ux.
Kenan.
Computers have lots of memory but no imagination
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2008 01:41 AM
тАО06-26-2008 01:41 AM
Re: I would like to find the name "XXDBD_OKS_PRICING_VALUES" in all the files under a directory
Thanks for the help.
Sajith
Sajith
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