Unix - create path of folders and file

后端 未结 11 2078
面向向阳花
面向向阳花 2020-12-22 18:20

I know you can do mkdir to create a directory and touch to create a file, but is there no way to do both operations in one go?

i.e. if I wa

11条回答
  •  心在旅途
    2020-12-22 18:53

    if [ ! -d /my/other ]
    then
       mkdir /my/other/path/here
       cp /my/long/path/here/thing.txt /my/other/path/here/cpedthing.txt
    fi
    

提交回复
热议问题