3.1.14. mkdir - make new directories.#

  • Use mkdir (Make Directory) to create a new folder.

mkdir [new folder name]
  • For example, create a folder called test.

mkdir test
mkdir myNewDir

The -p flag causes new intermediate directories to be created as necessary.

mkdir -p myNewDir/with/intermediate/directories

If the intermediate directories didn’t already exist, running the above command without the -p flag would return an error