how to rename a directory in linux code example

Example 1: linux change directory

// change directory in terminal
cd folder_name/subfolder_name

// go up one directory level
cd ..

// back to previous directory
cd -

// return to home directory
cd

Example 2: rename folder bash

mv /home/user/oldname /home/user/newname

Example 3: ubuntu rename folder

sudo mv oldName newName

Example 4: rename folder command line linux

mv old-name new-name

Example 5: how to rename the directory in terminal

mv [oldDirPath] [newDirPath]

Example 6: how to rename working directory in linux

$ mv <source_directory> <target_directory>

Tags:

Misc Example