相关疑难解决方法(0)

Unix - 创建文件夹和文件的路径

我知道你可以mkdir创建一个目录并touch创建一个文件,但是没有办法一次完成这两个操作吗?

即如果我想在文件夹other不存在时执行以下操作:

cp /my/long/path/here/thing.txt /my/other/path/here/cpedthing.txt
Run Code Online (Sandbox Code Playgroud)

错误:

cp: cannot create regular file `/my/other/path/here/cpedthing.txt': No such file or directory
Run Code Online (Sandbox Code Playgroud)

有没有人想出一个功能作为解决方法?

unix linux bash shell scripting

117
推荐指数
6
解决办法
13万
查看次数

标签 统计

bash ×1

linux ×1

scripting ×1

shell ×1

unix ×1