Linux mv command, move files and folders using the terminal
ID: 365
Category: Linux Terminal
Added: 3rd of December 2023
Views: 567
This tutorial covers basic usage of using the mv command, to move files and folders using the linux terminal
To move sample1.txt file from folder1 to folder2 issue the following command
mv folder1/sample1.txt folder2/
To move sample1.txt file from folder2 back to folder1
mv folder2/sample1.txt folder1/
To move multiple files from folder1 to folder2 issue the following command
mv folder1/* folder2/
Move only files with extension .jpg from folder1 to folder2
mv folder1/*.jpg folder2/
Move only files with extension .jpg and .gif from folder1 to folder2
mv folder1/*.{jpg,gif} folder2/
To move folder1 and all it's contents inside folder2
mv folder1 folder2
To move folder1 back to your current directory
mv folder2/folder1 ./
Related Tips & Tutorials
➔ Create a new folder and file using the mkdir and touch commands using the terminal in Linux