2.9.12. Creating, Deleting and Managing Directories

Linux for Programmers and Users, Section 3.17, 3.21

See also

pwd

2.9.12.1. cd

cd

A shell built-in command to change working directory. With no directory listed, cd returns to The HOME Directory.

SYNOPSIS

cd [DIRECTORY]

See also

Manual pages for pushd and popd

2.9.12.2. mkdir

mkdir

Create the DIRECTORY(ies), if they do not already exist.

SYNOPSIS

mkdir DIRECTORY…

2.9.12.3. rmdir

rmdir

Remove the DIRECTORY(ies), if they are empty.

SYNOPSIS

rmdir DIRECTORY…

Example using mkdir, cd, pwd, and rmdir

$ mkdir first
$ cd first
$ pwd
/usr1.b/bobk/first
$ cd
$ pwd
/usr1.b/bobk
$ cp myfile myfile2
$ ls my*
myfile myfile2
$ rmdir first
rmdir: first: Directory not empty
$