更新时间:2023-12-05 20:31:28
而读取-r文件名;做
rm $ filename
完成< list.txt
是
rm $(< list.txt)
$ p如果参数太多,$ p>将会失败。
我认为应该可以:
xargs -a list.txt -d'\n'rm
I have a list of files in a .txt file (say list.txt). I want to delete the files in that list. I haven't done scripting before. Could some give the shell script/command I can use. I have bash shell.
while read -r filename; do rm "$filename" done <list.txt
is slow.
rm $(<list.txt)
will fail if there are too many arguments.
I think it should work:
xargs -a list.txt -d'\n' rm