<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic supressing error messages in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446460#M208063</link>
    <description>Hi,&lt;BR /&gt;Can somebody help me in solving this small problem ...I want to avoid displaying the error messages on the screen (Eg:Given)while &lt;BR /&gt;searching for a particular file &lt;BR /&gt;find / -name test -print |grep -sv test&lt;BR /&gt;find: cannot search /etc/ftpd (Errors)&lt;BR /&gt;find: cannot open /etc/opt/resmon/persistence&lt;BR /&gt;find: cannot open /etc/opt/resmon/pipe&lt;BR /&gt;find: cannot open /etc/sam/custom&lt;BR /&gt;find: cannot search /etc/Tivoli/tec&lt;BR /&gt;find: cannot open /tmp/.AgentSockets&lt;BR /&gt;find: cannot search /tmp/mail.old/maillog.31104&lt;BR /&gt;find: cannot open /home/jhazen&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Bins</description>
    <pubDate>Sat, 18 Dec 2004 10:20:16 GMT</pubDate>
    <dc:creator>Party</dc:creator>
    <dc:date>2004-12-18T10:20:16Z</dc:date>
    <item>
      <title>supressing error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446460#M208063</link>
      <description>Hi,&lt;BR /&gt;Can somebody help me in solving this small problem ...I want to avoid displaying the error messages on the screen (Eg:Given)while &lt;BR /&gt;searching for a particular file &lt;BR /&gt;find / -name test -print |grep -sv test&lt;BR /&gt;find: cannot search /etc/ftpd (Errors)&lt;BR /&gt;find: cannot open /etc/opt/resmon/persistence&lt;BR /&gt;find: cannot open /etc/opt/resmon/pipe&lt;BR /&gt;find: cannot open /etc/sam/custom&lt;BR /&gt;find: cannot search /etc/Tivoli/tec&lt;BR /&gt;find: cannot open /tmp/.AgentSockets&lt;BR /&gt;find: cannot search /tmp/mail.old/maillog.31104&lt;BR /&gt;find: cannot open /home/jhazen&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Bins</description>
      <pubDate>Sat, 18 Dec 2004 10:20:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446460#M208063</guid>
      <dc:creator>Party</dc:creator>
      <dc:date>2004-12-18T10:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: supressing error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446461#M208064</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try this.&lt;BR /&gt;&lt;BR /&gt;# find / -name test -type f | xargs grep -l "test"&lt;BR /&gt;&lt;BR /&gt;Robert-Jan</description>
      <pubDate>Sat, 18 Dec 2004 11:38:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446461#M208064</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2004-12-18T11:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: supressing error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446462#M208065</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;It is not working &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Binu</description>
      <pubDate>Sat, 18 Dec 2004 11:53:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446462#M208065</guid>
      <dc:creator>Party</dc:creator>
      <dc:date>2004-12-18T11:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: supressing error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446463#M208066</link>
      <description>find / -name 'test' -type f 2&amp;gt;/dev/null | grep -sv 'test'</description>
      <pubDate>Sat, 18 Dec 2004 12:10:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446463#M208066</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-12-18T12:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: supressing error messages</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446464#M208067</link>
      <description>The error messages are written to stderr rather than stdout. Since your screen is (by default) configured to show both, just redirect the errors (stderr) to /dev/null by using file descriptor 2:&lt;BR /&gt; &lt;BR /&gt;find / -name test 2&amp;gt;/dev/null&lt;BR /&gt; &lt;BR /&gt;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.&lt;BR /&gt; &lt;BR /&gt;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.</description>
      <pubDate>Sat, 18 Dec 2004 22:43:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/supressing-error-messages/m-p/3446464#M208067</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-12-18T22:43:19Z</dc:date>
    </item>
  </channel>
</rss>

