Linux创建文件【命令】

来源:互联网 发布:电力交易中心 知乎 编辑:程序博客网 时间:2024/06/10 18:13

在/opt/hello 目录下创建 world.txt

使用命令:touch 文件名

touch world.txt

----------------------------------------

touch “摸”。touch[文件名],就是摸一下文件,如果文件不存在,就建立新文件。
如果存在,就改变文件访问时间atime等时间戳信息。

创建文件也可以用echo
如:echo>/data/hello.txt 或 >/data/hello.txt 也可以创建文件。

当然很有很多可以间接创建文件的命令,如 vi  cat 等

只不过touch是专业的。



0 0
原创粉丝点击