The -p option in the mkdir command allows you to create parent directories as needed. This means that if the specified parent directory does not exist, it will be created automatically.
Example:
If you run:
mkdir -p /path/to/new/directory
- If
/path/todoes not exist, it will be created along withnewanddirectory. - If any of the parent directories already exist,
mkdir -pwill not raise an error and will simply create the specified directory.
This option is useful for creating nested directory structures in a single command. If you have more questions, feel free to ask!
