取决于文件应该包含什么:
点击/path/to/file获取一个空文件 somecommand > /path/to/file用于包含某命令输出的文件。 例如:grep——help > randomtext.txt echo "This is some text" > randomtext.txt Nano /path/to/file或vi /path/to/file(或任何其他编辑器emacs,gedit等)
它将打开现有的文件进行编辑,或者创建&打开一个空文件进入,如果它不存在