Make dir if not exist in bash

image_pdfimage_print
if [ ! -d directory ]; then
  mkdir directory
fi


if you dont have sub directories you need to  use    "-p"  option

mkdir -p  /dxx/xx/xx/xx/e/3/3/5/DIRECTORY


if [[ ! -e $dir ]]; then
    mkdir $dir
elif [[ ! -d $dir ]]; then
    echo "$dir already exists but is not a directory"
fi