linux touch命令 创建文件

 

 

touch 创建文件,用法,touch test.txt,如果文件存在,则表示修改当前文件时间

[root@MongoDB ~]# touch /data/text.txt
[root@MongoDB ~]# ls /data/
text.txt

 

[root@MongoDB ~]# touch text.txt
[root@MongoDB ~]# ls
anaconda-ks.cfg  text.txt

 

touch file{1..3}.txt 创建3个文件

[root@MongoDB ~]# touch file{1..3}.txt
[root@MongoDB ~]# ll
total 4
-rw-------. 1 root root 1851 Mar 27 08:38 anaconda-ks.cfg
-rw-r--r--  1 root root    0 May 18 07:41 file1.txt
-rw-r--r--  1 root root    0 May 18 07:41 file2.txt
-rw-r--r--  1 root root    0 May 18 07:41 file3.txt

 

 
posted @ 2019-04-18 19:43  minger_lcm  阅读(5996)  评论(0编辑  收藏  举报