- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- /usr/bin/rm: arg list too long
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 08:42 PM
тАО01-07-2004 08:42 PM
/usr/bin/rm: arg list too long
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 08:48 PM
тАО01-07-2004 08:48 PM
Re: /usr/bin/rm: arg list too long
ls | xargs rm
find . -exec rm {} \;
rm [a-l]*;rm [m-z]* might work too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 08:50 PM
тАО01-07-2004 08:50 PM
Re: /usr/bin/rm: arg list too long
I use this command when i have so many files created under sendmail queue directory.
This will delete all the files in the current directory , so be CAREFUL.
These commands will delete all the files in /var/mail/queue:
cd /var/nail/queue
for i in *
do
rm $i
done
Hope this helps
-Vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 08:52 PM
тАО01-07-2004 08:52 PM
Re: /usr/bin/rm: arg list too long
this thread may help you ...
http://forums1.itrc.hp.com/service/forums/questionanswer.do?admit=716493758+1073555363536+28353475&threadId=211841
Sunil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 08:54 PM
тАО01-07-2004 08:54 PM
Re: /usr/bin/rm: arg list too long
be careful if you use the find command as it will do sub directories too. If thats not an issue then its a good way to do it. Otherwise try using some wildcards to reduce the number of files
rm *txt
rm backup*
:-) John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 08:56 PM
тАО01-07-2004 08:56 PM
Re: /usr/bin/rm: arg list too long
rm -r /mydir
mkdir /mydir
:-) John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 09:00 PM
тАО01-07-2004 09:00 PM
Re: /usr/bin/rm: arg list too long
Hi,
I think this is something to do with argument list length. There is kernel parameter large_ncargs_enable, if this is set to 0, the maximum argument list can be up to 20478 bytes. If this parameter is enabled argument list to any command can be up to 20478000 bytes.
Otherwise you can use any of the option listed above, like xargs, find ...etc.
Hope this helps
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 09:10 PM
тАО01-07-2004 09:10 PM
Re: /usr/bin/rm: arg list too long
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2004 11:04 PM
тАО01-07-2004 11:04 PM
Re: /usr/bin/rm: arg list too long
if you try a "rm
echo
Heiner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-08-2004 12:34 AM
тАО01-08-2004 12:34 AM
Re: /usr/bin/rm: arg list too long
large_ncargs_enabled 1
And recompile the kernel by hand. This was true for 10.20, I don't recall doing it for 11.x.
We used to have super long directories of thousands of files for arched stat data packets. Often if our scripts that didn't go through and whack these files I would have to go in by hand to delete them. On the servers we didn't have this, I had to loop through the files like said above. But the servers that we added this line to I never seemed to of ran into any limitation to the number of files in the directory.
We never had issues after enabling it.
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-08-2004 01:48 AM
тАО01-08-2004 01:48 AM
Re: /usr/bin/rm: arg list too long
For instance, ls and ll should never be run on the directory without an highly limited pattern match. For instance, if you need a file that starts with aaaa, don't type ls a* since the * may match 10,000 filenames and you'll get the arg list too long message. Instead, the filename must be explicit enough to match only a handful of files. Otherwise, the users and script writers will have to become familiar with xargs.
Bill Hassell, sysadmin