在 Linux 下 9 个有用的 touch 命令示例

2018-5-2 孤独求学人 Linux

touch 命令用于创建空文件,也可以更改 Unix 和 Linux 系统上现有文件时间戳。这里所说的更改时间戳意味着更新文件和目录的访问以及修改时间。

让我们来看看 touch 命令的语法和选项:

语法:

# touch {选项} {文件}
touch 命令中使用的选项:

touch-command-options

touch-command-options

在这篇文章中,我们将介绍 Linux 中 9 个有用的 touch 命令示例。

示例:1 使用 touch 创建一个空文件
要在 Linux 系统上使用 touch 命令创建空文件,键入 touch,然后输入文件名。如下所示:

[root@linuxtechi ~]# touch devops.txt
[root@linuxtechi ~]# ls -l devops.txt
-rw-r--r--. 1 root root 0 Mar 29 22:39 devops.txt

阅读全文>>

标签: linux cat touch stat

评论(0) 浏览(16499)

Powered by emlog 豫ICP备15004178号-1