Recently, when sorting out the drawing bed files , Because there are too many files , perform cp Command prompt Argument list too long. Simply put, the reasons and solutions !
Question why
stay Linux Next use cp/mv/rm When ordered , I often come across Argument list too long error .
This is mainly because cp/mv/rm The number of files is too large .
resolvent
Argument list too long The solution to this problem mainly uses two commands find and xargs.
Here to delete dusays Directory to com Suffix file as an example :
find dusays/ -name "*.com" | xargs -i rm -f {}find dusays/ -name "*.com" -exec rm -f {} \;Copy dusays Directory to com Suffix file to 7bu Catalog :
find dusays/ -name "*.com" | xargs -i cp {} 7bu/find dusays/ -name "*.com" -exec cp {} 7bu/ \;xargs A filter for passing parameters to other commands , It is also a tool for combining multiple commands . and -i The parameter will xargs The content of is assigned to {}.



![[gym103660] the 19th Zhejiang University City College Programming Contest vp/s](/img/97/655aa436d42340db4fc12c7c79b863.png)


![[XSS range 10-14] insert when you see parameters: find hidden parameters and various attributes](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)

