我想将文本文件复制到具有多个带有大括号的名称的目录:
cp /path/to/file/a.txt /path/to/file/{b,c,d}.txt
但它给了我错误:target '/path/to/directory/d.txt' is not a directory
答案1
for i in {b,c,d}; do cp /path/to/directory/a.txt /path/to/file/$i.txt; done
我想将文本文件复制到具有多个带有大括号的名称的目录:
cp /path/to/file/a.txt /path/to/file/{b,c,d}.txt
但它给了我错误:target '/path/to/directory/d.txt' is not a directory
for i in {b,c,d}; do cp /path/to/directory/a.txt /path/to/file/$i.txt; done