How to mkdir -p only if a directory does not already exist?
Wednesday, Aug 7, 2024
Linux bash provides the mkdir command in order to create directory. By default the mkdir command creates single directory but can not create child or sub directories. The mkdir -p command is used to create new directory with subdirectories or child directories.
Create a single directory: You can create single directory with sub directories like below.
mkdir -p /path/to/directory Create multiple nested directories: You can create single directrory with nested child directories.
@
İsmail Baydan
2 minutes read