Rm * An error occurred while deleting too many files/bin/rm: Argumentlisttoo solution

Source: Internet
Author: User
Rm * An error occurred while deleting too many files/bin/rm: Argumentlisttoo solved the problem of too many Chinese files in a single directory in Linux, if you try to use rm * to delete all files, the error/bin/rm: Argumentlisttoolong will be returned. it is said that this is because all of...
Rm * An error occurred while deleting too many files/bin/rm: Argument list too solved the problem of too many Chinese files in a single directory in Linux, if you try to use rm * to delete all files, the error/bin/rm: Argument list too long will be reported. it is said that this is because all exec functions (execl, execlp, execle, etc.) in the Linux kernel finally call execve (), execve stores the command parameters and environment variables that are passed to the new process through a 128 k memory space. When the command line parameters generated by commands such as rm exceed 128 KB, the E2BIG error is reported in Linux kernel. The solution of www.2cto.com is to use the find command to first find the file name to be deleted and then use the pipeline to batch pass it to rm for deletion. For example, to delete the files in the mqueue directory where sendmail is accumulated: find/var/spool/mqueue/-type f-name '*'-print0 | xargs-0 rm
(The-0 Parameter prevents space in the file name and rm recognizes it as two different files .) Author: h13327840728
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.