I’d like to create a folder ubuntu/airflow/dags/survey_tools under my home directory. But I don’t want to create it fold by fold. Could I make it with only 1 command?
(base) xxxx@xxxx-MacBook-Pro /home % pwd
/home
(base) xxxx@xxxx-MacBook-Pro /home % ls
(base) xxxx@xxxx-MacBook-Pro /home %
(base) xxxx@xxxx-MacBook-Pro /home % mkdir -p ubuntu/airflow/dags/survey_tools
mkdir: ubuntu/airflow/dags/survey_tools: Operation not supported
>Solution :
Yes, that’s mkdir -p
mkdir -p ubuntu/airflow/dags/survey_tools
From man mkdir:
-p
Create intermediate folders as required. If this option is
not specified, the full path prefix of each operand must already
exist. On the other hand, with this option specified, no error
will be reported if a directory given as an operand already
exists.