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
[[email protected] bdump]$ find. -name "Epps_q001_*" | Wc-l
8438
You can solve this problem by Xargs command at this time. As shown below:
[[email protected] bdump]$ find. -name "Epps_q001_*" | Xargs Rm-r
Xiaoxiang Hidden Source: http://www.cnblogs.com/kerrycode/
If you really feel that the article is well written and helpful to you, then you might as well give a little reward, if the bag is shy, may wish to help "recommend", your "recommendation" and "reward" will be my greatest writing power!
This article is copyrighted by the author, welcome reprint, but without the consent of the author must retain this paragraph, and in the article page obvious location to give the original text connection. Good text to the top of my collection this article Xiaoxiang hermit
Follow-146
Fans-1795 honors: Recommended blog + add attention to 10? Previous post: SQL Server Delete distribution database
? Next post: ora-01113:file xxxx needs media recovery
Linux RM Delete large batch files