Rename Linux file, using mv command



Configuration for GNU Linux Fedora Computer using Linux Command

 

    How to rename file in Linux??? The mv command can be use to rename file on Linux system.  The step by step example below show how to rename Linux file using mv command on Linux fedora system.

Create necessary file for rename file example:

1.  Create file using touch command.

Create linux file using touch command

[fedora@fedora ~]$ touch linux_file_example.txt

[fedora@fedora ~]$

 

2.  Verify the file is created.

List linux file inside directory

[fedora@fedora ~]$ ls

Desktop Download Music Public Videos

Documents linux_file_example.txt Pictures Templates

[fedora@fedora ~]$

 

Rename Linux file.

3.  Use the mv command to rename linux_file_example.txt file, to new file name rename_linux_file.txt.

Rename Linux file example

[fedora@fedora ~]$ mv linux_file_example.txt rename_linux_file.txt

[fedora@fedora ~]$

 

Rename command explanation:

Explaination on rename linux file

 

4.  Use ls command to verify the file name changes

List files and directory

[fedora@fedora ~]$ ls

Desktop Download Pictures rename_linux_file.txt Videos

Documents Music Public Templates

[fedora@fedora ~]$

 




0 comments: