Loading... <strong>说明:</strong>有时候用<code>rm -rf*</code>删除文件时会出现<code>-bash:/bin/rm:Argument list too long</code>错误提示,这句话意思应该文件过大,删除失败,这时候可以通过<code>xargs</code>命令来解决。 <div data-unique="方法"></div> <h2>方法</h2> <strong>注意:</strong>未免误删,请在需要删除的文件目录下进行操作! <strong>1、文件数量较少情况下</strong> <pre><code class="hljs nginx"><span class="hljs-attribute">ls</span> | xargs rm -f</code></pre> 目录下文件可都一起删除 <strong>2、文件数量很多的时候</strong> <pre><code class="hljs nginx"><span class="hljs-attribute">ls</span> | xargs -n <span class="hljs-number">10</span> rm -rf </code></pre> 通过xargs命令,将文件10个分成一组,然后分批删除,这样就不会出现错误了。 最后修改:2022 年 08 月 02 日 © 允许规范转载 打赏 赞赏作者 赞 0 如果觉得我的文章对你有用,请随意赞赏