13. mv command - muneeb-mbytes/linux_course GitHub Wiki

mv command

"mv' stands for move. The mv command is used to move one or more files or directories from one place to another in a file system like LINUX.

It has two distinct functions:

S.No mv commands Description
1. mv source destination Moves a file to different path
2. mv old_name new_name Renames the file
3. mv --helpGives more info about mv command on terminal

Syntax: mv source destination

The Figure.1. shows how to move a file into directory.

Untitled Diagram-Page-7 drawio (1)

                       Figure.1. Usage of mv command

The GIF-1 shows the whole process from sourcing scripting file till the output.

mv

                        GIF-1:  mv command gif  

Github lab link: https://github.com/muneeb-mbytes/linux_course/blob/b7_Team_SiliconCrew/mv_commands/mv_command.csh


rename command

"rename' stand for rename the files. The rename command is not available by default.
To use mv to rename a file type . after moving the contains old file will be deleted.
Syntax: mv old_name new_name

The Figure.2. shows how to rename the files name.

Untitled Diagram-Page-8 drawio (2)

                          Figure.2. Usage of rename command 

The GIF-2 shows the whole process from sourcing scripting file till the output.

rn_mv

                           GIF-2:  rename command gif

Github lab link :https://github.com/muneeb-mbytes/linux_course/blob/b7_Team_SiliconCrew/mv_commands/rename_command.csh

mv --help

This command is use to learn more on mv command usage . By running this command , it will show all the flag options with their uses.

Syntax: mv --help


To learn cp command: https://github.com/muneeb-mbytes/linux_course/wiki/14.-cp_command