Quick tips: move multiple files/folders with mv command

One of the first things that new users of Linux will learn is using mv command to move or rename files. It’s simple enough. Many people will then continue using it in this simple way, but like almost everything in Linux, it’s more powerful than it seems. Here’s is today’s quick tip: How to move multiple files or folders to another folder.

Let’s say that we have multiple files with different names and we want to move then to a directory. Simple approach would be to run mv multiple times, but we don’t want that. mv has -t switch which is used to specify target and then we can list multiple sources.

mv -t target_dir source_file_a source_file_b c_file

This will move to “target_dir” those three files.

Leave a Reply

Your email address will not be published. Required fields are marked *

Reload Image