Linux实用教程(第2版)课件第5章文件和目录.ppt

Linux实用教程(第2版)课件第5章文件和目录.ppt

5.3.4 touch:创建空文件、更改文件或目录时间 使用touch命令可以创建空文件以及更改文件或目录的时间。 命令语法: touch [-acfm][-d 日期时间][-r 参考文件或目录][-t 日期时间] [文件] 【例5.9】 创建空文件file,file1和file2。 【例5.10】 将文件file1的时间记录改为5月7日19点30分,时间格式为MMDDHHmm。 [root@PC-LINUX ~]# touch file1 [root@PC-LINUX ~]# touch file2 file3 [root@PC-LINUX ~]# ls -l file1 file2 file3 -rw-r--r--. 1 root root 0 6月 3 05:45 file1 -rw-r--r--. 1 root root 0 6月 3 05:45 file2 -rw-r--r--. 1 root root 0 6月 3 05:45 file3 //file1,file2,file3这3个都是空文件,文件内没有任何数据 【例5.10】 将文件file1的时间记录改为6月7日19点30分,时间格式为MMDDHHmm。 [root@PC-LINUX ~]# ls -l file1 -rw-r--r--. 1 root root 0 6月

文档评论(0)

1亿VIP精品文档

相关文档