根据您希望文件包含的内容:
touch /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
(或any other editor emacs,gedit etc
)
它可以打开现有文件进行编辑,也可以创建并打开一个空文件以输入(如果不存在)



