Copy/Move Multiple Files From One Directory To Another

Need to copy or move multiple files at once using the terminal in OS X, Linux and Windows? I’ll show you how it can be done.

When you work from the command line terminal you need to make every command count. Copying or moving files in an UNIX based operating system can be a very repetitive task. There are more complex ways of doing it, you can maybe write a script file that you can execute overtime you want to copy or move files but that is reserved for more advanced tasks. If you want to copy or move a few files around you only need the cp command. Here is how it looks like:

cp /path/to/src/{doc_file.docx,pdf_file.pdf,text_file.txt} /path/to/dst

If you want to move files instead of copying them just use this command:

mv /path/to/src/{doc_file.docx,pdf_file.pdf,text_file.txt} /path/to/dst

Now in windows the preferred method is robocopy, there is little you can’t do with robocopy.

robocopy path\to\src path\to\dst doc_file.docx pdf_file.pdf text_file.txt

That’s all, simple enough!

No Comments, Be The First!

Leave a Reply