想要改进这个问题吗? 通过 editing this post 添加详细信息并澄清问题.
关闭 2 年前。
在 Linux 终端中创建文件最简单的方法是什么?
最佳答案
取决于您希望文件包含的内容:
触摸/path/to/file
获取空文件somecommand >/path/to/file
用于包含某些命令输出的文件。
eg: grep --help > randomtext.txt
echo "This is some text" > randomtext.txt
nano/path/to/file
或 vi/path/to/file
(或 任何其他编辑器 emacs、gedit 等
)
它要么打开现有文件进行编辑,要么创建并打开空文件以输入(如果它不存在)
https://stackoverflow.com/questions/9381463/