③linux基础命令 touch

touch 创建文件
touch file 无则创建 有责修改创建时间
[root@rstx-201 ~]# touch file
[root@rstx-201 ~]# ll
-rw-r--r--  1 root root    0 Feb 25 22:28 file
[root@rstx-201 ~]# touch file
[root@rstx-201 ~]# ll
-rw-r--r--  1 root root    0 Feb 25 22:29 file  #有则修改创建时间
touch 同时创建多个文件
[root@rstx-201 ~]# touch file file1
[root@rstx-201 ~]# ll
-rw-r--r--  1 root root    0 Feb 25 22:36 file
-rw-r--r--  1 root root    0 Feb 25 22:36 file1

[root@rstx-201 ~]# touch {a,b,c}
[root@rstx-201 ~]# ll
-rw-r--r--  1 root root    0 Feb 25 22:41 a
-rw-r--r--  1 root root    0 Feb 25 22:41 b
-rw-r--r--  1 root root    0 Feb 25 22:41 c

touch 同时创建多个文件
[root@rstx-201 ~]# touch file{1..4}
[root@rstx-201 ~]# ll
-rw-r--r--  1 root root    0 Feb 25 22:37 file1
-rw-r--r--  1 root root    0 Feb 25 22:37 file2
-rw-r--r--  1 root root    0 Feb 25 22:37 file3
-rw-r--r--  1 root root    0 Feb 25 22:37 file4

[root@rstx-201 ~]# ll
-rw-r--r--  1 root root    0 Feb 25 22:39 filea
-rw-r--r--  1 root root    0 Feb 25 22:39 fileb
-rw-r--r--  1 root root    0 Feb 25 22:39 filec
........
-rw-r--r--  1 root root    0 Feb 25 22:39 filez
posted @ 2021-02-26 11:40  老夫聊发少年狂88  阅读(56)  评论(0)    收藏  举报