5

How can I move multiple folders into another directory ? For example, I would like to move the folder 000/ 001/ 002/ to train/000/ train/002 train/003. Is there a simple command that I can use like

mv --from 000/ 001/ 002/ --to train/000/ train/002 train/003
muru
  • 197,895
  • 55
  • 485
  • 740
Kong
  • 1,241

2 Answers2

9

I could type whatever was typed in this article again, but here: https://discuss.devopscube.com/t/how-to-move-mv-multiple-directories-or-files-to-a-folder-at-a-time/100

The basic command is:

You can do this using -t flag with the mv command.

The syntax would look like the following.

  mv -t <destination> <src1> <src2> .... <srnN>
terdon
  • 100,812
2

I would suspect:

mv {001..100}/ train/

Just replace 100 with your folder range.