Move and Rename file/folder with mv command

Windows Articles

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...

How to recover files deleted with Windows File Recovery

Hello! Deleting files by accident is one of the biggest fears of users. Indeed, unintentionally deleting documents, music or photos can be...

How to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10?

This is a short post in which I will show you how to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10...

Linuxfx is a Windows 10 clone based on Ubuntu.

Hi! Most Windows users are afraid to switch to Linux for various reasons. However, the biggest one is the difference in the...

How to install OpenMeetings on Ubuntu 20.04 / 18.04?

If there is one thing the Internet has completely revolutionized, it is long-distance communications. And with it the business meetings that thanks to many...
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

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...

How to recover files deleted with Windows File Recovery

Hello! Deleting files by accident is one of the biggest fears of users. Indeed, unintentionally deleting documents, music or photos can be...

How to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10?

This is a short post in which I will show you how to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10...

Linuxfx is a Windows 10 clone based on Ubuntu.

Hi! Most Windows users are afraid to switch to Linux for various reasons. However, the biggest one is the difference in the...

How to install OpenMeetings on Ubuntu 20.04 / 18.04?

If there is one thing the Internet has completely revolutionized, it is long-distance communications. And with it the business meetings that thanks to many...