How to Change File Name in Linux?

Use the `mv` command

Syntax: `mv old_filename new_filename`

Example: `mv file1.txt file2.txt`

To rename a file in the same directory, change only the name part

To move and rename at the same time, include the destination path

Example: `mv file1.txt /home/user/documents/file2.txt`

Use `rename` for batch renaming if available

Example: `rename ‘s/old/new/’ *.txt`

Check the renamed file with `ls`

Suggested for You

Trending Today