<?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: Simple question about eliminating files! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666076#M931245</link>
    <description>Hi Mynor,&lt;BR /&gt;&lt;BR /&gt;For safety purpose, NEVER put the -exec option (especially with rm -f) until you are sure the find actually returns the names you expect. A catastrophic result will take place if you accidently put a space in front of the * for your -name parameter !&lt;BR /&gt;&lt;BR /&gt;However, you can use 'xargs' command instead of -exec, if needed.&lt;BR /&gt;&lt;BR /&gt;find /dir_path -name '*pattern*' -depth -mtime days -print | xargs rm -f {}&lt;BR /&gt;&lt;BR /&gt;See man pages of xargs.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Shiju</description>
    <pubDate>Sat, 16 Feb 2002 17:46:05 GMT</pubDate>
    <dc:creator>Helen French</dc:creator>
    <dc:date>2002-02-16T17:46:05Z</dc:date>
    <item>
      <title>Simple question about eliminating files!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666073#M931242</link>
      <description>OK, here is a simple one for most of you.  I would like to use a command that can sort just certain files from a directory and then elminate those files meeting certain criteria.&lt;BR /&gt;&lt;BR /&gt;I have used the command "find /directory/filepattern  -mtime +days -print -exec rm -f {} \;"&lt;BR /&gt;&lt;BR /&gt;However, when I try this one the message I get is "/usr/bin/find: arg list too long".  The number of files meeting the pattern given is very (I mean very) long.  &lt;BR /&gt;&lt;BR /&gt;What other command may I use that will not care about the number of files found?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;ADAM</description>
      <pubDate>Sat, 16 Feb 2002 13:26:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666073#M931242</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2002-02-16T13:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question about eliminating files!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666074#M931243</link>
      <description>OK, I guess I found an answer, and probably some of the problem may have been my own syntax, this is what I am using now:&lt;BR /&gt;&lt;BR /&gt;"find /dir/subdir -name "*filepattern*" -mtime +daysold -print -exec rm -f {} \;&lt;BR /&gt;&lt;BR /&gt;This seems to work, other ways to do it?</description>
      <pubDate>Sat, 16 Feb 2002 14:04:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666074#M931243</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2002-02-16T14:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question about eliminating files!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666075#M931244</link>
      <description>Hi Mynor:&lt;BR /&gt;&lt;BR /&gt;You are probably running a 10.x environment.  The limitation of ARG_MAX is substantially relieved on 11.x.  With that aside, there is an easy solution which is also much less resource intensive.  Using 'exec' means a new process is spawned for every argument.  To avoid the limitation of ARG_MAX and to avoid a new process for every argument, do this:&lt;BR /&gt;&lt;BR /&gt;# find /directory/filepattern -type f -mtime +days | xargs -n 100 rm -f&lt;BR /&gt;&lt;BR /&gt;Have a look at the man pages for 'xargs' for more details.  Essentially this will process 100 arguments at a time until the list is exhausted.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 16 Feb 2002 17:28:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666075#M931244</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-02-16T17:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question about eliminating files!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666076#M931245</link>
      <description>Hi Mynor,&lt;BR /&gt;&lt;BR /&gt;For safety purpose, NEVER put the -exec option (especially with rm -f) until you are sure the find actually returns the names you expect. A catastrophic result will take place if you accidently put a space in front of the * for your -name parameter !&lt;BR /&gt;&lt;BR /&gt;However, you can use 'xargs' command instead of -exec, if needed.&lt;BR /&gt;&lt;BR /&gt;find /dir_path -name '*pattern*' -depth -mtime days -print | xargs rm -f {}&lt;BR /&gt;&lt;BR /&gt;See man pages of xargs.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Shiju</description>
      <pubDate>Sat, 16 Feb 2002 17:46:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666076#M931245</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2002-02-16T17:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Simple question about eliminating files!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666077#M931246</link>
      <description>Thank you both.  &lt;BR /&gt;&lt;BR /&gt;This is exactly what I was looking for.</description>
      <pubDate>Sat, 16 Feb 2002 19:35:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/simple-question-about-eliminating-files/m-p/2666077#M931246</guid>
      <dc:creator>MAD_2</dc:creator>
      <dc:date>2002-02-16T19:35:39Z</dc:date>
    </item>
  </channel>
</rss>

