EN
Bash create directory if not exists
2 points
Quick solution:
xxxxxxxxxx
1
mkdir -p /root/some_dir/some_dir_2
2
3
# NOTES:
4
5
# 1 - it will do nothing if all directories already exists
6
# so we can execute this command two times and no errors will occur
7
8
# 2 - it will create all subdirectory if they don't exists
9
# if some_dir and some_dir_2 doesn't exists this command will create both of them