Move and Rename file/folder with mv command

Windows Articles

How to install the Owncloud desktop client Ubuntu 20.04?

In this post, You will learn how to install the Owncloud desktop client on Ubuntu 20.04. Many users and...

How to finish a task and force to close a program in Windows 10

Hello! We use numerous applications in Windows 10 on a daily basis. However, these programs can fail and crash. That is, it...

How to install Android on a USB key

Hi! Android is a very versatile mobile operating system because it is based on Linux kernel and other open-source software, it can...

Microsoft releases emergency update.

Security is one of the fundamental issues for Microsoft in Windows 10. In fact, since it was launched, the company has changed...

How to remove Windows 10 network credentials

Hi! Every time you access a website using Windows 10, a lot happens. In fact, the system will store the credentials to...
Muhammad Nabeel
Muhammad Nabeel
Network and System Administrator

mv (move) is a Unix command that moves one or more files or directories from one place to another. It is also used to rename a file/folder.

In this article we will discus different examples of mv command.

Move a file or Directory

So, use below command to move your file from one place to another.

ls
mv file-name destination-path

In below example, I have moved a file “abc.txt” to a test folder placed in / path.

mv abc /
ls /

you can see example in below image

Move Multiple files

So, if you want to move multiple files into a directory in a single command, issue the following.

ls
mv file-one.txt file-two.txt file-three.txt /test
ls

you can see example in following image

Rename a File or Directory

Let say we have a file called exp.txt and we want to rename it as “demo.txt” then we will use following command

ls
mv exp.txt demo.txt
ls

Now you can see in below image that exp.txt file has been renamed with demo.txt

Now rename a directory test with testnew

ls
mv test testnew
ls

And that is it.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to install the Owncloud desktop client Ubuntu 20.04?

In this post, You will learn how to install the Owncloud desktop client on Ubuntu 20.04. Many users and...

How to finish a task and force to close a program in Windows 10

Hello! We use numerous applications in Windows 10 on a daily basis. However, these programs can fail and crash. That is, it...

How to install Android on a USB key

Hi! Android is a very versatile mobile operating system because it is based on Linux kernel and other open-source software, it can...

Microsoft releases emergency update.

Security is one of the fundamental issues for Microsoft in Windows 10. In fact, since it was launched, the company has changed...

How to remove Windows 10 network credentials

Hi! Every time you access a website using Windows 10, a lot happens. In fact, the system will store the credentials to...
x