WeCodeAcademy

Moving and Renaming with mv

mv source destination moves a file. If the destination is a folder, the file goes inside it. If it is a new name, the file is renamed.

Examplebash
Open in editor »
/ $

Move a file into a folder, then look inside it. .. is the folder above, so ../ reaches back out.

Examplebash
Open in editor »
/ $
Quick check

What does `mv old.txt new.txt` do when `new.txt` does not exist?

Your turn: write the code

Create draft.txt, rename it to final.txt, then list the folder.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.