1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Example uses of the Linux Command "mv"

An Introductory Tutorial


The "mv" command is commonly used for renaming a file and/or moving a file to another directory (folder).

To rename the file "titles.txt" in the current directory to "music_collection.txt" you would type

 mv titles.txt music_collection.txt 
To move the file "students.txt" from the current directory to the directory "/school" you can enter
 mv students.txt school/. 
The "." at the end means: place here without renaming. If you want to move and rename a file a file at the same time you would type:
 mv students.txt school/2nd_grade.txt 
  1. About.com
  2. Technology
  3. Linux
  4. Linux / Shell Commands
  5. Example uses of the command mv

©2014 About.com. All rights reserved.