Skip to main content

Unit 2 · Basic Commands · Lesson 16 of 34

Move it!

mv

We use the mv (move) command to move files in Linux.

Usage: mv old_path new_path

Unlike cp, mv doesn't leave a copy behind, it actually relocates the file. This also makes mv Linux's way of renaming files: moving a file to a new name in the same directory is effectively a rename, since Linux doesn't have a separate rename command.

Example: mv notes.txt final_notes.txt renames notes.txt to final_notes.txt in place.

Live Linux terminal

This lesson comes with a real Ubuntu machine that runs in your browser, so you type every command yourself. Create a free account to do this part.

Do this lesson for real

With a free account you get the terminal, the challenges and the checks that go with every lesson in Intro to Linux, and your progress is saved as you go. CyberAcad is a 501(c)(3) nonprofit, so there is nothing to pay.