<?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 Re: xdev in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/xdev/m-p/4301727#M338164</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I assume that by 'xdev' you mean the '-xdev' option of 'find'.  This option prevents 'find' from crossing mountpoints.  This is extremely useful when you truly want to only search the root filesystem, as in:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -30&lt;BR /&gt;&lt;BR /&gt;...which would find files modifed during the last 30-days.&lt;BR /&gt;&lt;BR /&gt;In the case of 'xargs' is seen in pipelines to construct lists of things on which execution is performed.  Since 'xargs' can collect multiple arguments into a list of arguments it can be used to greatly reduce the number of processes that you need to spawn.  A classic example of this is again with 'find'.  Consider:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -30 -exec ls -l {} \;&lt;BR /&gt;&lt;BR /&gt;...This spawns an 'ls' command for *every* file found (and therefore becomes costly).&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -30 | xargs ls -l {}  &lt;BR /&gt;&lt;BR /&gt;...spawns only one or very few processes depending on the argument list size making this very efficient.&lt;BR /&gt;&lt;BR /&gt;Now, in truth, 'find' has a newer syntax with its '-exec' that accomplishes the same thing as an 'xargs' pipe:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -30 -exec ls -l {} +&lt;BR /&gt;&lt;BR /&gt;The "+' instead of the escaped ";" triggers 'find's inbuilt buffering.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 06 Nov 2008 14:19:53 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-11-06T14:19:53Z</dc:date>
    <item>
      <title>xdev</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xdev/m-p/4301726#M338163</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How xdev and xargs helpful in scripting. how its working. What is the use of it. Pls explain&lt;BR /&gt;&lt;BR /&gt;Reagrds&lt;BR /&gt;Rkumar&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Nov 2008 14:08:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xdev/m-p/4301726#M338163</guid>
      <dc:creator>Waugh</dc:creator>
      <dc:date>2008-11-06T14:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: xdev</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xdev/m-p/4301727#M338164</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;I assume that by 'xdev' you mean the '-xdev' option of 'find'.  This option prevents 'find' from crossing mountpoints.  This is extremely useful when you truly want to only search the root filesystem, as in:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -30&lt;BR /&gt;&lt;BR /&gt;...which would find files modifed during the last 30-days.&lt;BR /&gt;&lt;BR /&gt;In the case of 'xargs' is seen in pipelines to construct lists of things on which execution is performed.  Since 'xargs' can collect multiple arguments into a list of arguments it can be used to greatly reduce the number of processes that you need to spawn.  A classic example of this is again with 'find'.  Consider:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -30 -exec ls -l {} \;&lt;BR /&gt;&lt;BR /&gt;...This spawns an 'ls' command for *every* file found (and therefore becomes costly).&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -30 | xargs ls -l {}  &lt;BR /&gt;&lt;BR /&gt;...spawns only one or very few processes depending on the argument list size making this very efficient.&lt;BR /&gt;&lt;BR /&gt;Now, in truth, 'find' has a newer syntax with its '-exec' that accomplishes the same thing as an 'xargs' pipe:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -mtime -30 -exec ls -l {} +&lt;BR /&gt;&lt;BR /&gt;The "+' instead of the escaped ";" triggers 'find's inbuilt buffering.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 06 Nov 2008 14:19:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xdev/m-p/4301727#M338164</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-11-06T14:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: xdev</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xdev/m-p/4301728#M338165</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;xdev:&lt;BR /&gt;xdev is to restrict search not to cross mount points. Default search will do it on mount points as well.&lt;BR /&gt;&lt;BR /&gt;For example if you want to search only on / and not to seach /var, /etc, etc then you need to specify xdev&lt;BR /&gt;&lt;BR /&gt;#find / -xdev -name *.txt -print&lt;BR /&gt;&lt;BR /&gt;xargs:&lt;BR /&gt;when you use -exec to pipe the output of find command to perform something else, &lt;BR /&gt;-exec will start a new process for each line of the output. Sometime -exec may not be able to handle this and command seems to be hung. xargs handle this perfectly. It will start only limited process&lt;BR /&gt;&lt;BR /&gt;#find / -user abc |xargs rm -rf {}&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Nov 2008 14:43:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xdev/m-p/4301728#M338165</guid>
      <dc:creator>Ganesan R</dc:creator>
      <dc:date>2008-11-06T14:43:48Z</dc:date>
    </item>
  </channel>
</rss>

