How to Rename Files and Directories in Linux

Last Updated on: June 18, 2020

Renaming file and directory is quite straight forward in Linux, in this guide I’ll show you how to do just that…

The mv command is among the useful utility for renaming, and moving files from one location to another, to rename a file, you use the following syntax:

					

mv [OPTIONS] source destination

To rename a file, you need to specify a single file as a source and single file as a destination target. For example, to rename the file book1.txt as book2.txt you would run:

You can also rename multiple files with a little of code, which is beyond this guide.

Comment policy: Respectful and beneficial comments are welcome with full open hands. However, all comments are manually moderated and those that doesn't relate with what the passage is saying or offensive comments would be deleted. Thanks for understanding!

Leave a Reply

Your email address will not be published. Required fields are marked *