You should pass the -p parameter to mkdir so it will create all the subfolders.
So following your example:
mkdir -p folder1/folder2/folder3
You should pass the -p parameter to mkdir so it will create all the subfolders.
So following your example:
mkdir -p folder1/folder2/folder3