The curly braces are expanded in "brace expansion" (see man bash
). So your last line is expanded to
mv 1.txt 2.txt 3.txt ... 13.txt Week 1 Week 2 ... Week 13
If you look into man mv
, you'll see
mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...
It doesn't list anything like
mv [OPTION] SOURCE1 DEST1 SOURCE2 DEST2
You can use a loop to distribute the files into the directories:
for n in {1..13} ; do
mv "$n".txt "Week $n"
done
If you aren't doing anything else with the files but creating them, you can in fact create them directly in the loop, so you don't need to create them in the same directory initially:
for n in {1..13} ; do
mkdir "Week $n"
touch "Week $n/$n.txt"
done
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…