If you have a directory on your Ubuntu Linux, Unix, or macOS system and you want to rename it via the command line Terminal, you can make use of the mv - move files command.
Syntax:
mv dir-name renamed-dir
Let's take a look at a few examples:
Example 1:
Let's say you have a directory named mydir in the current directory and you want to rename it to mydir_archive.
% mv mydir mydir_archive

Example 2:
Let's say you have a directory named mydir directory somewhere and you want to rename it to mydir_archive. In this case, you need to provide the absolute paths.
% mv /Users/c2ctech/desktop/mydir /Users/c2ctech/desktop/mydir_archive
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!