# Move Multiple Files in Linux with Ease

Moving files is a common task when working with Linux. Whether you need to organize your folders, back up important data, or transfer files between directories, the `mv` command in Linux is a powerful tool that allows you to easily relocate multiple files at once.

This article will guide you through the process of moving multiple files in Linux, explaining the command syntax and providing practical examples to help you master this essential skill.

## Understanding the `mv` Command

The `mv` command, short for "move," is a Linux terminal command that allows you to move files and directories from one location to another. It can be used to move a single file or multiple files simultaneously.

When moving multiple files, you simply need to specify the source files and the destination directory.

## Moving Multiple Files to a Different Directory

To move multiple files to a different directory, you need to follow this basic syntax:

```plaintext
mv file1 file2 file3 ... /path/to/destination_directory
```

Here's an example:

```plaintext
mv document1.txt document2.txt photo.jpg /home/user/Documents
```

This command will move the files `document1.txt`, `document2.txt`, and `photo.jpg` to the `/home/user/Documents` directory.

%[https://linux101.hashnode.dev/understanding-linux-devices] 

## Moving Files with Wildcard Characters

In some cases, you may want to move a group of files that share a common pattern in their names. Linux allows you to use wildcard characters to select these files more easily. The most common wildcard characters are:

* `*` (asterisk) matches any sequence of characters
    
* `?` (question mark) matches any single character
    

For example, to move all text files in the current directory to a new folder called `TextFiles`, you can use the following command:

```plaintext
mv *.txt /home/user/TextFiles
```

This command will move all files with the `.txt` extension to the `/home/user/TextFiles` directory.

## Renaming Files During the Move

The `mv` command can also be used to rename files while moving them. The syntax for this is:

```plaintext
mv /path/to/old_filename /path/to/new_directory/new_filename
```

For example, to move the file `document.txt` to the `Documents` directory and rename it to `important_file.txt`, you would use:

```plaintext
mv /home/user/document.txt /home/user/Documents/important_file.txt
```

## Moving Files Interactively

If you're dealing with a large number of files and want to be more selective about which ones to move, you can use the `-i` (interactive) option with the `mv` command. This option will prompt you to confirm or skip each file before moving it.

```plaintext
mv -i file1 file2 file3 ... /path/to/destination_directory
```

%[https://linux101.hashnode.dev/the-best-linux-certifications-for-your-career] 

## Conclusion

Moving multiple files in Linux is a straightforward process with the `mv` command. By understanding the command syntax and using wildcard characters, you can efficiently move and organize your files. Additionally, the `-i` option allows for interactive file selection, providing greater control over the moving process. With these tools at your disposal, managing your files in Linux becomes a breeze.
