What is the 'mv' command?

QuestionsQuestions8 SkillsProBasic Files OperationsAug, 14 2025
0193

The mv command in Linux is used to move or rename files and directories. Here are its primary functions:

  1. Move Files: You can move a file from one location to another.

    mv source.txt /path/to/destination/
  2. Rename Files: You can rename a file or directory.

    mv oldname.txt newname.txt
  3. Move and Rename: You can move a file and rename it in one command.

    mv /path/to/source.txt /new/path/newname.txt

The command can also include options for safer operations, like -i for interactive mode, which prompts before overwriting files.

If you have more questions or need examples, feel free to ask!

0 Comments

no data
Be the first to share your comment!