Rename a directory using Linux/Unix command


To rename a directory in a Linux or Unix-based system you can make use of quite a few commands, one of them is an mv command. Let's see some examples,

Syntax: mv fromDirName toNewDirName

% mkdir myDir

% cd myDir

% touch myFile.txt

% cd ..

% mv myDir myDir1

% ls
myfile.txt

Top Hashtags:

Advertisements

Advertisements




Advertisements