自学linux指令分析-touch

自学linux指令分析-touch

 

1·命令格式

touch [optionsfile-list

touch 【参数】【文件名】

2·命令参数

-a                    只更新访问时间,不改变修改时间

-c                    不创建不存在的文件

-m                   只更新修改时间,不改变访问时间

-r file               使用文件file的时间更新文件的时间

-t                     将时间修改为参数指定的日期,如:07081556代表7月8号15点56分

3、命令功能

创建文件或修改文件时间

4、命令范列

      实列一:在/data建立文件test.txt

        命令:touch /data/test.txt

[root@ban new]# touch /data/test.txt
[root@ban new]# ll /data
total 0
-rw-r--r--. 1 root root 0 Apr 11 14:34 test.txt

        命令:cd /data;touch test.txt

[root@ban new]# cd /data;touch test.txt
[root@ban new]# ll /data
total 0
-rw-r--r--. 1 root root 0 Apr 11 14:34 test.txt

 

posted @ 2017-04-11 14:35  极光无影_烽  阅读(202)  评论(0编辑  收藏  举报