<?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: Remove Files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386478#M665089</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The number of times people equate 'ctime' to a creation time in UNIX is sad!&lt;BR /&gt;&lt;BR /&gt;The 'ctime' is _NOT_ a creation time in UNIX!&lt;BR /&gt;&lt;BR /&gt;Rather the 'ctime' represtents the last _change_ time for permisssions, owenerships and/or a name.&lt;BR /&gt;&lt;BR /&gt;The 'ctime' _may_ coincidently be equivalent to the moment of creation (represented by the first instantiation of '-mtime').  Subsequent modifications to the file or directory's contents alter (update) the 'mtime'.&lt;BR /&gt;&lt;BR /&gt;To find (and remove) files older than 30-days do:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f -mtime +30 -exec rm {} +&lt;BR /&gt;&lt;BR /&gt;The '-xdev' prevents crossing mountpoints.  The '-type f' specifies files only (not directories too).  The '-mtime +30' says to look for things that are older than 30-days (where one day is 24-hours).  The '-exec rm {} +' causes a 'rm' command to be run for an argument list generated.  THe '+' terminator causes multiple arguments to be bundled to each command making the process run faster and spawn significantly less children (an expensive thing).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Tue, 24 Mar 2009 10:45:39 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-03-24T10:45:39Z</dc:date>
    <item>
      <title>Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386474#M665085</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;I want to delete the file which older then 30 days then would you please let me know the command.&lt;BR /&gt;&lt;BR /&gt;Files are in /var/&lt;DIRNAME&gt;/&lt;BR /&gt;&lt;BR /&gt;OS HPUX 11.11&lt;/DIRNAME&gt;</description>
      <pubDate>Tue, 24 Mar 2009 08:32:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386474#M665085</guid>
      <dc:creator>Eric Jacklin</dc:creator>
      <dc:date>2009-03-24T08:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386475#M665086</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;find /var/dirname -type f -mtime +30 -exec rm {} \;</description>
      <pubDate>Tue, 24 Mar 2009 08:53:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386475#M665086</guid>
      <dc:creator>Ganesan R</dc:creator>
      <dc:date>2009-03-24T08:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386476#M665087</link>
      <description>Hi,&lt;BR /&gt;The file which havn't been modified in last 30-days&lt;BR /&gt;&lt;BR /&gt;# find /yourpath -xdev -type f -mtime +30 -exec rm -rf {} \;&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Tue, 24 Mar 2009 09:35:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386476#M665087</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-03-24T09:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386477#M665088</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;find has a parameter for file detection, called +mtime That means modify time.&lt;BR /&gt;&lt;BR /&gt;You can also check create time with +ctime&lt;BR /&gt;&lt;BR /&gt;find /location -type f -ctime +30 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;find /location -type f -mtime +30 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;This will work on files except those with open file handles on them&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Tue, 24 Mar 2009 09:46:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386477#M665088</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-03-24T09:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386478#M665089</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The number of times people equate 'ctime' to a creation time in UNIX is sad!&lt;BR /&gt;&lt;BR /&gt;The 'ctime' is _NOT_ a creation time in UNIX!&lt;BR /&gt;&lt;BR /&gt;Rather the 'ctime' represtents the last _change_ time for permisssions, owenerships and/or a name.&lt;BR /&gt;&lt;BR /&gt;The 'ctime' _may_ coincidently be equivalent to the moment of creation (represented by the first instantiation of '-mtime').  Subsequent modifications to the file or directory's contents alter (update) the 'mtime'.&lt;BR /&gt;&lt;BR /&gt;To find (and remove) files older than 30-days do:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f -mtime +30 -exec rm {} +&lt;BR /&gt;&lt;BR /&gt;The '-xdev' prevents crossing mountpoints.  The '-type f' specifies files only (not directories too).  The '-mtime +30' says to look for things that are older than 30-days (where one day is 24-hours).  The '-exec rm {} +' causes a 'rm' command to be run for an argument list generated.  THe '+' terminator causes multiple arguments to be bundled to each command making the process run faster and spawn significantly less children (an expensive thing).&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 24 Mar 2009 10:45:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386478#M665089</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-24T10:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386479#M665090</link>
      <description>Hello gourou,&lt;BR /&gt;&lt;BR /&gt;I agree with all propositions. Thanks James for your detail answer. I have a question for James. With the + sign at the end of command rm  wil be executed one time with all arguments given by find ! How many argument can be given to rm ?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 25 Mar 2009 07:49:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386479#M665090</guid>
      <dc:creator>Roland Piette</dc:creator>
      <dc:date>2009-03-25T07:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386480#M665091</link>
      <description>&amp;gt;How many argument can be given to rm?&lt;BR /&gt;&lt;BR /&gt;Lots but it depends on the length of each one.  ;-)&lt;BR /&gt;I'm not sure what the limit find uses.  You could invoke a script to count them and their lengths.</description>
      <pubDate>Wed, 25 Mar 2009 07:56:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386480#M665091</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-03-25T07:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386481#M665092</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;&amp;gt; How many argument can be given to rm?&lt;BR /&gt;&lt;BR /&gt;To add to Dennis's answer, I suspect that 'find' assembles as large a list as possible, passes the list to the command (here, 'rm') and then assembles a new list until every object is satisfied.&lt;BR /&gt;&lt;BR /&gt;Before the advent of the '+' terminator for such assembly, the way to gain performance, was to do:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f -mtime +30 | xargs rm &lt;BR /&gt;&lt;BR /&gt;THis allowed 'xargs' to perform multiple argument assembly repetively until the arguments were exhausted, for as large a list as it could handle each time. &lt;BR /&gt;&lt;BR /&gt;With 'xargs' should you wish to _control_ the number of arguments you pass (which is sometimes desired), you can add the -n' switch, like:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f -mtime +30 | xargs -n 10 rm&lt;BR /&gt;&lt;BR /&gt;...which would bundle 10 arguments together for each 'rm' process that it was necessary to spawn.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF... &lt;BR /&gt;</description>
      <pubDate>Wed, 25 Mar 2009 10:52:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386481#M665092</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-03-25T10:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386482#M665093</link>
      <description>Files are in /var/&lt;DIRNAME&gt;/&lt;BR /&gt;&lt;BR /&gt;Be very, very careful!&lt;BR /&gt;&lt;BR /&gt;There are a lot of very important files under /var , even with older dates, e.g. /var/adm/sw&lt;BR /&gt;&lt;BR /&gt;Manually deleting files there will corrupt your system.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIRNAME&gt;</description>
      <pubDate>Wed, 25 Mar 2009 11:12:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386482#M665093</guid>
      <dc:creator>Torsten.</dc:creator>
      <dc:date>2009-03-25T11:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386483#M665094</link>
      <description>&amp;gt;JRF: I suspect that 'find' assembles as large a list as possible&lt;BR /&gt;&lt;BR /&gt;Yes.  The source says it starts with ARG_MAX (getconf _SC_ARG_MAX) around 2 Mb, then subtracts PATH_MAX and roughly the size of the current environment.</description>
      <pubDate>Wed, 25 Mar 2009 19:15:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-files/m-p/4386483#M665094</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-03-25T19:15:55Z</dc:date>
    </item>
  </channel>
</rss>

