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.
mv dir-name renamed-dir
Let's take a look at a few examples:
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
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
Facing issues? Have Questions? Post them here! I am happy to answer!
- Rename a directory using Linux/Unix command
- ls command to list only directories
- How to Restart or Reload Nginx Server Service on Linux
- 3 ways to clear screen on Linux Terminal
- ls command: sort files by name alphabetically A-Z or Z-A [Linux/Unix/macOS/Bash]
- Copy entire directory using Terminal Command [Linux, Mac, Bash]
- Fix: sudo: unable to open Read-only file system
- Create Hidden File or Directory using Shell Command
- Command to know the installed Debian version?
- The Date Command and its usage [Linux - Unix - macOS]
- Fix - bash: man: command not found
- How to tar.gz a directory or folder Command
- How to Display content of a file in Terminal Screen?
- How to change bash terminal prompt string and color
- Sort ls command by last modified date and time
- Execute .bin and .run file Ubuntu Linux
- zsh hello world example
- How to check uptime of Linux/Unix/macOS system/server using console command?
- [Fix] Linux - bash: useradd: command not found
- Command to check Last Login or Reboot History of Users and TTYs
- How to install and Configure sar sysstat tools in Ubuntu Linux
- How to use SCP Command to Copy Directory
- Linux Remove or Delete Files and Directories using Terminal Commands
- How to connect to SSH port other than default 22
- Install OpenSSL on Linux/Ubuntu
- Take Screenshot on Mac OS X (Keyboard Shortcuts) - Mac-OS-X
- How to Remove All Terminated Console tabs at once in Eclipse - Eclipse
- What is list[-1] in Python Programming - Python
- How to Send Email using Java - Java
- How to List All Users in Linux - Linux
- Fix: bash: syntax error near unexpected token - Bash
- Change SharePoint Online List Experience to New Experience from Classic - SharePoint