mv Command in Linux : Move and Rename File or Directory

mv Command in Linux : Move and Rename File or Directory

Hello friends, welcome to Inet 70. Today, I can guide you on How to use the mv command in Linux/Unix. It is too useful if you use Linux or Unix operating systems. This command is used to rename file directories and more. It is a very useful tool for every Linux user. Now, we can start this tool’s user guide and get more information about the mv command in Linux operating systems.

mv command in Linux

Here, I can explain this command with example files and screenshots. In this content, I can include both uses of this.

Move File With mv Command

By using this command, you can move the file to change the source file name to the destination file name.

				
					mv [source_file_name] [Destination_file_name]
				
			

From the given command, you can put the current file name at the [source_file_name] and put the replaced file name at [Destination_file_name]. Now, we can discuss this file with the given example.

Suppose I have one file “Latest.zip” available on my Linux server. Now, I need to replace the filename to “wordpress.zip”. Then, you can follow the command at the given file directory:

				
					mv latest.zip wordpress.zip
				
			

After putting this command, your file name is successfully changed. You can show this on the given screenshot. Now, we can start the process to move the files location with the mr command in Linux.

Move files with my command

Move any file or folder to any location with my command. This use is too easy. Now, you can use the given step to start the moving process:

				
					mv [source_file_name] [source_file_path]
				
			

In this command, you can put the source folder name at [Source_File_name] and when you move this file fath their puth at [source_file_puth]. For example, I have “wordpress.zip” file available, and I need to move this file to “/var/www” location bath. Then, I need to put the following command:

				
					mv wordpress.zip /var/www/
				
			

This command also works for files and folders. You can use both mv for both.

Thanks for visiting my blog. If you like this page, then you can press the bell icon to subscribe to my blog for getting all new blog post’s notifications.