Bash 从Unix中的另一个目录在某个目录中创建文本文件
我想知道如果您想从unix中的另一个目录在某个目录中创建文件,代码会是什么样子 例如:Bash 从Unix中的另一个目录在某个目录中创建文本文件,bash,unix,Bash,Unix,我想知道如果您想从unix中的另一个目录在某个目录中创建文件,代码会是什么样子 例如: File to be created: pop.txt Directory to create that in: /home/p1 Directory you are currently in and are to make it from: /home/pokemon/master/ 谢谢 就这么简单你可以用这种方法。 因为触摸只能创建一个空文件。但这也可以添加内容 cat>/home/p1/pop.tx
File to be created: pop.txt
Directory to create that in: /home/p1
Directory you are currently in and are to make it from: /home/pokemon/master/
谢谢
就这么简单你可以用这种方法。
因为触摸只能创建一个空文件。但这也可以添加内容
cat>/home/p1/pop.txt
vim>/home/p1/pop.txt
在终端中使用cat。维姆是一名编辑
还有其他方法可以用吗
cat>./../p1/pop.txt
vim.././p1/pop.txt
。。表示返回参考或上一个目录。如果答案正确,请将其标记为正确。否则堆栈溢出将不知道问题是否已解决。
touch /home/p1/pop.txt