linux touch命令 创建文件

时间:2023-03-08 22:31:03
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{..}.txt
[root@MongoDB ~]# ll
total
-rw-------. root root Mar : anaconda-ks.cfg
-rw-r--r-- root root May : file1.txt
-rw-r--r-- root root May : file2.txt
-rw-r--r-- root root May : file3.txt