<?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: Max arguments for rm command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429505#M639952</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://h30499.www3.hp.com/t5/General/chmod-command-on-long-list-of-files/m-p/4239270#M136190"&gt;http://h30499.www3.hp.com/t5/General/chmod-command-on-long-list-of-files/m-p/4239270#M136190&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rgs.&lt;/P&gt;</description>
    <pubDate>Tue, 27 Dec 2011 13:39:29 GMT</pubDate>
    <dc:creator>rariasn</dc:creator>
    <dc:date>2011-12-27T13:39:29Z</dc:date>
    <item>
      <title>Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429423#M639945</link>
      <description>&lt;P&gt;Dear Admins,&lt;/P&gt;&lt;P&gt;How do i determine the maximum arguments allowed in rm command? i.e number of files allowed in rm command to delete at a time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SERVER1:/home/sit&amp;gt;ls -lrt|wc -l&lt;BR /&gt;34813&lt;BR /&gt;SERVER:/home/sit&amp;gt;rm *&lt;BR /&gt;sh: /usr/bin/rm: The parameter list is too long.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;V2P&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2011 11:45:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429423#M639945</guid>
      <dc:creator>V2P</dc:creator>
      <dc:date>2011-12-27T11:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429433#M639946</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[E2BIG] The number of bytes in the new program'sargument list plus environment is greater&lt;BR /&gt;than the system-imposed limit. This limit isat least 5120 bytes on HP-UX systems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;man 2 exec&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rgs,&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2011 12:01:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429433#M639946</guid>
      <dc:creator>rariasn</dc:creator>
      <dc:date>2011-12-27T12:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429439#M639947</link>
      <description>&lt;P&gt;&amp;gt;How do I determine the maximum arguments allowed in rm command?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't.&amp;nbsp; You have your plan A which is just "rm *".&lt;/P&gt;&lt;P&gt;Note: A closer estimate would be: { env; ls; } | wc -c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you have a total length of all of the files about 2 Mb, then you switch to plan B:&lt;/P&gt;&lt;P&gt;find . -type -f -exec rm -f {} +&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Or you always use plan B.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;This limit is at least 5120 bytes on HP-UX systems.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It is about 2 Mb and "-exec ... +" knows what it is, compared to dumb xargs(1).&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2011 05:36:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429439#M639947</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-12-28T05:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429455#M639948</link>
      <description>Hello Denis,&lt;BR /&gt;SERVER1:/home/sit&amp;gt;ls |wc -c&lt;BR /&gt;2022086&lt;BR /&gt;Bytes would be 2022086&lt;BR /&gt;SERVER1:/home/sit&amp;gt;ls |wc -l&lt;BR /&gt;31707&lt;BR /&gt;Here am able to delete the 31707 files with rm*. Is this the same calc u meant?</description>
      <pubDate>Tue, 27 Dec 2011 12:39:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429455#M639948</guid>
      <dc:creator>V2P</dc:creator>
      <dc:date>2011-12-27T12:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429457#M639949</link>
      <description>Hello rariasn,&lt;BR /&gt;SERVER1:/home/sit&amp;gt;ls |wc -c&lt;BR /&gt;2022086&lt;BR /&gt;Bytes would be 2022086&lt;BR /&gt;SERVER1:/home/sit&amp;gt;ls |wc -l&lt;BR /&gt;31707&lt;BR /&gt;Here am able to delete the 31707 files with rm*. Is this the same calc u meant?</description>
      <pubDate>Tue, 27 Dec 2011 12:40:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429457#M639949</guid>
      <dc:creator>V2P</dc:creator>
      <dc:date>2011-12-27T12:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429469#M639950</link>
      <description>&lt;P&gt;&amp;gt; ls | wc -c 2022086&lt;BR /&gt;&amp;gt;Bytes would be 2022086&lt;BR /&gt;&amp;gt;Here am able to delete the 31707 files with rm *. Is this the same calc you meant?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm saying that 2 Mb may be too large to pass as arguments.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2011 13:48:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429469#M639950</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-12-27T13:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429487#M639951</link>
      <description>&lt;P&gt;But here am able to delete the files with rm * command. Then what parameter manages the rm max args?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2011 13:18:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429487#M639951</guid>
      <dc:creator>V2P</dc:creator>
      <dc:date>2011-12-27T13:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429505#M639952</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://h30499.www3.hp.com/t5/General/chmod-command-on-long-list-of-files/m-p/4239270#M136190"&gt;http://h30499.www3.hp.com/t5/General/chmod-command-on-long-list-of-files/m-p/4239270#M136190&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rgs.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2011 13:39:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429505#M639952</guid>
      <dc:creator>rariasn</dc:creator>
      <dc:date>2011-12-27T13:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429507#M639953</link>
      <description>&lt;P&gt;&amp;gt;But here am able to delete the files with rm * command. Then what parameter manages the rm max args?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok, I found the limit is more like 2 Mb:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://h30499.www3.hp.com/t5/System-Administration/usr-bin-cp-the-parameter-list-is-too-long/td-p/4449811"&gt;http://h30499.www3.hp.com/t5/System-Administration/usr-bin-cp-the-parameter-list-is-too-long/td-p/4449811&lt;/A&gt;&lt;/P&gt;&lt;P&gt;$ getconf ARG_MAX&lt;BR /&gt;2048000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a fixed value.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2011 13:51:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429507#M639953</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-12-27T13:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429779#M639954</link>
      <description>&lt;P&gt;The correct answers are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There is no limit to the number of files that can be deleted, but&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;there is a limit to the number of characters on the command line&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So for the specific example: rm *&lt;/P&gt;&lt;P&gt;The star * is a special character for the shell and for default environments, it will effectively rewrite the command line with rm plus the names of all the files in the current directory. If every file is exactly two letters (as in aa, ab, ac, ad...Aa, Ab, Ac...11, 12, 13,...) then about 666,000 files can be removed with the rm command (2 characters plus 1 space).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it has nothing to do with the number of files, it has to do with the length of the resultant command line. It is not a good idea to think of managing massive numbers of files with simple file matching characters like "*".&amp;nbsp; The first consideration is what can you do to stop the madness of having thousands of files in one directory. HP-UX has no problems with thousands, even millions of files in one directory. But the fact that it can be done does not make it a good idea. Most of the massive directory problems I have seen have been due to bad designs trying to create a database with files rather than using a real database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if you are forced to deal with a bad design that will not be fixed, the next best is to use command lines that will work and avoid those that fail or take enormous amounts of time (and disk I/O). Assuming your current directory has 1 million files, the first commands to avoid are simple ls and ll commands. The result will scroll off the top of your screen, onto the floor and down the stairs...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead, you limit the listing to what you are really looking for. If you are looking for files that start with the characters abc and end with 123, then limit the match: ls abc*123 . If you need to remove all the files in a directory (with no subdirectories), then use rm -r mydirname and *not* rm mydirname/*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the directory has subdirectories, you'll have to be more creative by breaking the filenames into manageable groups.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2011 02:01:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429779#M639954</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2011-12-28T02:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Max arguments for rm command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429931#M639955</link>
      <description>&lt;P&gt;&amp;gt;the next best is to use command lines that will work and avoid those that fail or take enormous amounts of time (and disk I/O).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's why plan B should be used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;the first commands to avoid are simple ls and ll commands. The result will scroll off the top of your screen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can always redirect the output.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If you need to remove all the files in a directory (with no subdirectories), then use rm -r mydirname and *not* rm mydirname/*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right.&amp;nbsp; And copy the permissions/owners if needed to recreate the directory.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;If the directory has subdirectories, you'll have to be more creative by breaking the filenames into manageable groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plan B doesn't have any issues with this, unless you don't want to remove subdirectories.&amp;nbsp; And then with the appropriate -prune, that will work too.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2011 05:34:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/max-arguments-for-rm-command/m-p/5429931#M639955</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-12-28T05:34:28Z</dc:date>
    </item>
  </channel>
</rss>

