- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Fail rm command: Arguments 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
Forums
Discussions
Discussions
Discussions
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
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-20-2008 03:42 PM
01-20-2008 03:42 PM
Fail rm command: Arguments too long.
I need remove approximately 32000 files, but when I execute the rm command:
Host:user> rm *.YUT
Arguments too long.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2008 05:43 PM
01-20-2008 05:43 PM
Re: Fail rm command: Arguments too long.
you can try to use the find command to remove the files.
e.g. find . -name \*.YUT -exec rm {} \;
GOOD LUCK!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2008 05:54 PM
01-20-2008 05:54 PM
Re: Fail rm command: Arguments too long.
You could use rm if you give it a subset of files:
$ rm [a-b]*.YUT
>Warren: you can try to use the find command to remove the files.
e.g. find . -name \*.YUT -exec rm {} \;
Yes, this will always work. You can also speed it up if you replace "\;" by "+".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2008 08:25 PM
01-20-2008 08:25 PM
Re: Fail rm command: Arguments too long.
# ls -1 *.YUT | xargs -n10 rm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2008 09:04 PM
01-20-2008 09:04 PM
Re: Fail rm command: Arguments too long.
# ls -1 *.YUT | xargs -n10 rm
Probably lots more than 10. Either 100 or 40. With the right patches/config, you can do up to 1 Mb at a time.
The above ls(1) will fail exactly the same as rm(1). You need to use ls and grep:
$ ls | grep "\.YUT$" | xargs -n40 rm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2008 09:12 PM
01-20-2008 09:12 PM
Re: Fail rm command: Arguments too long.
Moreover, it is generally a very poor design that puts so many files in a directory even if the argument limit is never reached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2008 12:38 AM
01-21-2008 12:38 AM
Re: Fail rm command: Arguments too long.
-f Remove all files (whether write-protected or not) in a directory without prompting the user. In a write-protected directory, however, files are never removed (whatever their permissions are), but no messages are displayed. If the removal of a write-protected directory is attempted, this option will not suppress an error message.
-i Interactive. With this option, rm prompts for confirmation before removing any files. It over- rides the -f option and remains in effect even if the standard input is not a terminal.
-R Same as -r option.
-r Recursively remove directories and subdirectories in the argument list. The directory will be emptied of files and removed. The user is normally prompted for removal of any write-protected files which the directory contains. The write-protected files are removed without prompting, however, if the -f option is used, or if the standard input is not a terminal and the -i option is not used. Symbolic links that are encountered with this option will not be traversed. If the removal of a non-empty, write-protected directory is attempted, the utility will always fail (even if the -f option is used), resulting in an error message.
filenames A path of a filename to be removed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2008 09:10 PM
01-22-2008 09:10 PM