To move multiple files at once using the mv command, you can list the files you want to move followed by the destination directory. Here’s how to do it:
Example 1: Specifying Each File
If you know the names of the files, you can specify them directly:
mv file1.txt file2.txt file3.txt /path/to/destination/
Example 2: Using Wildcards
If you want to move files that share a common pattern, you can use wildcards. For example, to move all .txt files:
mv *.txt /path/to/destination/
Example 3: Moving Files with Different Extensions
You can also combine different files with various extensions in a single command:
mv file1.txt file2.jpg file3.pdf /path/to/destination/
Example 4: Moving All Files in a Directory
To move all files from a specific directory to another directory, you can use:
mv /path/to/source/* /path/to/destination/
This will move all files from the source directory to the destination directory.
