- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to find all the file names whose
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
12-28-2003 07:43 PM
12-28-2003 07:43 PM
i.e. doing grep -l 'string' *
in every directory.
Thanks in advance!
Henry
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 07:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 07:53 PM
12-28-2003 07:53 PM
Re: How to find all the file names whose
find / -name "*string*"
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 07:54 PM
12-28-2003 07:54 PM
Re: How to find all the file names whose
find . -name "*" -exec grep -il 'string' {} \;
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:05 PM
12-28-2003 08:05 PM
Re: How to find all the file names whose
Yes, both of you perfectly answered my question. But, still one problem, I wrote like following,
find . -print -exec grep -l 'string' {} \;
why this command could not give me the correct output?
Thanks !
Henry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:13 PM
12-28-2003 08:13 PM
Re: How to find all the file names whose
have u try:
#find . -type f -print |xargs grep -l 'string'
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:26 PM
12-28-2003 08:26 PM
Re: How to find all the file names whose
-print option causes the current path name to be printed. So regardless of grep command, it returns all the file names in the current directory.
Regards
ALPER ONEY
I.S.E TAKASBANK INC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:34 PM
12-28-2003 08:34 PM
Re: How to find all the file names whose
I'm almost clear. But,
find . -print -exec rm -r {} \;
works fine, why?
Regards,
Zhe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2003 08:46 PM
12-28-2003 08:46 PM
Re: How to find all the file names whose
for your second example, it is ok to take all the file names(no filter) as the parameter of the command rm -r. But for the example including grep command, you need to get file names only including given string.
Because you do not need to filter any files, you second example works.
I hope it helps.
Regards
ALPER ONEY
I.S.E TAKASBANK INC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2003 12:15 PM
12-29-2003 12:15 PM
Re: How to find all the file names whose
I got it! Thank a lot!
Regards
Zhe