Argument list too long error for rm, cp, mv commands

前端 未结 27 2812
长情又很酷
长情又很酷 2020-11-22 04:50

I have several hundred PDFs under a directory in UNIX. The names of the PDFs are really long (approx. 60 chars).

When I try to delete all PDFs together using the fol

27条回答
  •  不知归路
    2020-11-22 05:19

    The rm command has a limitation of files which you can remove simultaneous.

    One possibility you can remove them using multiple times the rm command bases on your file patterns, like:

    rm -f A*.pdf
    rm -f B*.pdf
    rm -f C*.pdf
    ...
    rm -f *.pdf
    

    You can also remove them through the find command:

    find . -name "*.pdf" -exec rm {} \;
    

提交回复
热议问题