- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: supressing error messages
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-18-2004 02:20 AM
12-18-2004 02:20 AM
Can somebody help me in solving this small problem ...I want to avoid displaying the error messages on the screen (Eg:Given)while
searching for a particular file
find / -name test -print |grep -sv test
find: cannot search /etc/ftpd (Errors)
find: cannot open /etc/opt/resmon/persistence
find: cannot open /etc/opt/resmon/pipe
find: cannot open /etc/sam/custom
find: cannot search /etc/Tivoli/tec
find: cannot open /tmp/.AgentSockets
find: cannot search /tmp/mail.old/maillog.31104
find: cannot open /home/jhazen
Thanks
Bins
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2004 03:38 AM
12-18-2004 03:38 AM
Re: supressing error messages
Try this.
# find / -name test -type f | xargs grep -l "test"
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2004 03:53 AM
12-18-2004 03:53 AM
Re: supressing error messages
It is not working
Thanks
Binu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2004 04:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2004 02:43 PM
12-18-2004 02:43 PM
Re: supressing error messages
find / -name test 2>/dev/null
I'm not sure why your grep -v is there. The combination of -name test with grep -v test will produce nothing. Note also that grep is non-selective. That means that it will match /var/tmp/testing. Now in your example, find will locate *ANYTHING* with test as a name (ie, directory, socket, symbolic link, named pipe, file, etc). If you are looking for a file, add -type f to your search.
And lastly, if this is a single user workstation, find / is probably OK. But on a large server, the search will interfere with every program that also uses the disks. It will search mounted CDROMs, NFS mounpoints on other computers, all the database files, etc. When you are looking for a particulat file, it is less invasive (and much faster) to limit the search to a specific set of directories.
Bill Hassell, sysadmin