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
0

2 Answers 2

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>
2
  • Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Thomas Ward
    Dec 3, 2018 at 0:22
  • 1
    mv -t 10 11 12 HW mv: illegal option -- t 😕 🐚 is zsh
    – CodeFinity
    Jul 29, 2021 at 13:02
2

I would suspect:

mv {001..100}/ train/

Just replace 100 with your folder range.

0

Not the answer you're looking for? Browse other questions tagged .