Linux RM Delete large batch files

Source: Internet
Author: User

When using RM to delete a large batch of files, it is possible to encounter the problem of "parameter column too Long" (Argument list too long). As shown below

[Email protected] bdump]$ rm-v epps_q001_*
-bash:/bin/rm:argument list too long

See how many of these files are in total, as shown below, with a total of 8,348 files

[Email protected] bdump]$ LS-LRT epps_q001_* | Wc-l
-bash:/bin/ls:argument list too long
0
"Epps_q001_*" | Wc-l
8438

You can solve this problem by Xargs command at this time. As shown below:

"Epps_q001_*" | Xargs Rm-r

Linux RM Delete large batches of files

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.