- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- finding files
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
01-19-2001 07:45 AM
01-19-2001 07:45 AM
I need on hp-ux 11 to find files that does not contain a particular word.
For example I need to find all files that the word "willy" is not present.
Anybody can help me?
Roberto
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2001 07:52 AM
01-19-2001 07:52 AM
Re: finding files
here you are:
find
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2001 07:56 AM
01-19-2001 07:56 AM
Re: finding files
# grep -v willy *
This will operate on all files in the current directory displaying the filenames where "willy" does NOT exist.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2001 07:58 AM
01-19-2001 07:58 AM
Solutionfind /thedirectory -print | xargs grep -c "willy" | grep ":0$"
The "-c" option of grep returns number of lines that pattern exists. The second grep will display those filenames that don't have "willy".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2001 08:05 AM
01-19-2001 08:05 AM
Re: finding files
Go to the dir you wish to search
find . -type f | while read line
do
if grep "willy" $line > /dev/null
then
echo $line
fi
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2001 06:46 AM
01-22-2001 06:46 AM
Re: finding files
grep -v willy *
display the content of all files except the lines containing "willy"
Scripts of Joseph and Rodney do what I need.
Thank you all
Sincerly
Roberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2001 07:08 AM
01-22-2001 07:08 AM
Re: finding files
I've added -v to the line
if grep "paperino" $line > /dev/null
and had what I need.
Thanks
Regards
Roberto