If you use the mkdir to create a directory inside a directory you would get an error,
# mkdir dir1/dir2
mkdir: cannot create directory 'dir1/dir2': No such file or directory
To create a nested directories like dir1/dir2 you need to pass in an optional argument -p or --parents along with it.
Example:
# mkdir -p dir1/dir2/dir3

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!