mkdir if not exist code example Example 1: mkdir create if not exists mkdir -p foo/bar/baz Example 2: bash cd or make dir if not exists mkdir -p foo