To create parent directories in one command, you can use the mkdir command with the -p option. This allows you to create a hierarchy of directories, including any necessary parent directories that do not already exist.
Command:
mkdir -p /path/to/parent/directory/new_directory
Example:
If you want to create a directory structure like /home/labex/project/subdir, you would run:
mkdir -p /home/labex/project/subdir
Explanation:
-p: This option tellsmkdirto create parent directories as needed./home/labex/project/subdir: This is the full path where you want to create the new directory.
Feel free to ask if you have more questions!
