sudo: unable to execute /bin/rm: Argument list too long

Linux,删除文件夹下所有内容,数据太多时,报错too long

sudo rm -r /var/lib/jenkins/workspace/test_1/allure-report/data/attachments/*

sudo: unable to execute /bin/rm: Argument list too long

解决办法:

sudo find /var/lib/jenkins/workspace/test_1/allure-report/data/attachments/ -type f -exec rm {} \;

sudo find /var/lib/jenkins/workspace/test_1/allure-report/data/test-cases/ -type f -exec rm {} \;

 

sudo find /var/lib/jenkins/workspace/test_1/test_report -type f -exec rm {} \;

 

posted @ 2023-12-06 16:26  努力工作,早日退休  阅读(8258)  评论(0编辑  收藏  举报