Mac终端,是否可以创建文件夹的文件夹?

Mac terminal, is it possible to create a folder of folder?

我想在我的主目录下创建一个文件夹 ubuntu/airflow/dags/survey_tools。但我不想逐层创建它。我可以只用 1 个命令吗?

(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

是的,那是 mkdir -p

mkdir -p ubuntu/airflow/dags/survey_tools

来自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.