相关疑难解决方法(0)

管道 find -name 到 xargs 导致文件名没有传递给命令的空格

通常要删除文件名中带有空格的文件,您必须运行:

$ rm "file name"
Run Code Online (Sandbox Code Playgroud)

但如果我想删除多个文件,例如:

$ find . -name "*.txt" | xargs rm
Run Code Online (Sandbox Code Playgroud)

这不会删除其中包含空格的文件。

command-line rm find xargs

32
推荐指数
1
解决办法
4万
查看次数

标签 统计

command-line ×1

find ×1

rm ×1

xargs ×1