week-note-190108

栏目: 编程工具 · 发布时间: 7年前

内容简介:我们可以看到在使用touch命令后,socket.c文件和目录cprimer的时间已修改为当前系统时间。

touch命令

Linux touch命令用于修改文件或者目录的时间属性,包括存取时间和更改时间。若文件不存在,系统会建立一个新的文件。

注意到touch命令是在 youtube 上的一个video,对一个存在的文件,使用touch命令将更新文件或者目录的时间属性。
[root@centos-linux-10 workspace]# ll -al
总用量 80
drwxr-xr-x. 3 root root  4096 12月 31 15:05 .
dr-xr-x---. 7 root root  4096 12月 31 15:05 ..
drwxr-xr-x. 2 root root  4096 1月   3 23:35 cprimer
-rwxr-xr-x. 1 root root  9904 12月 11 16:59 getopt
-rw-r--r--. 1 root root   413 12月 11 16:59 getopt.c
-rwxr-xr-x. 1 root root 10416 12月 11 17:10 getopt_long
-rw-r--r--. 1 root root   777 12月 11 17:09 getopt_long.c
-rwxr-xr-x. 1 root root 10104 12月 11 18:17 man
-rw-r--r--. 1 root root   955 12月 11 18:17 man.c
-rw-r--r--. 1 root root  1491 12月 11 11:18 socket.c
-rwxr-xr-x. 1 root root 11088 12月 11 11:10 webbench
-rw-r--r--. 1 root root   278 12月 11 10:16 webbench.c
[root@centos-linux-10 workspace]# 
[root@centos-linux-10 workspace]# 
[root@centos-linux-10 workspace]# touch socket.c 
[root@centos-linux-10 workspace]# touch cprimer/
[root@centos-linux-10 workspace]# ll -al
总用量 80
drwxr-xr-x. 3 root root  4096 12月 31 15:05 .
dr-xr-x---. 7 root root  4096 12月 31 15:05 ..
drwxr-xr-x. 2 root root  4096 1月   4 00:11 cprimer
-rwxr-xr-x. 1 root root  9904 12月 11 16:59 getopt
-rw-r--r--. 1 root root   413 12月 11 16:59 getopt.c
-rwxr-xr-x. 1 root root 10416 12月 11 17:10 getopt_long
-rw-r--r--. 1 root root   777 12月 11 17:09 getopt_long.c
-rwxr-xr-x. 1 root root 10104 12月 11 18:17 man
-rw-r--r--. 1 root root   955 12月 11 18:17 man.c
-rw-r--r--. 1 root root  1491 1月   4 00:11 socket.c
-rwxr-xr-x. 1 root root 11088 12月 11 11:10 webbench
-rw-r--r--. 1 root root   278 12月 11 10:16 webbench.c
[root@centos-linux-10 workspace]#

我们可以看到在使用touch命令后,socket.c文件和目录cprimer的时间已修改为当前系统时间。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

像程序员一样思考

像程序员一样思考

V. Anton Spraul / 徐波 / 人民邮电出版社 / 2013-6 / 49.00元

编程的真正挑战不是学习一种语言的语法,而是学习创造性地解决问题,从而构建美妙的应用。《像程序员一样思考》分析了程序员解决问题的方法,并且教授你其他图书所忽略的一种能力,即如何像程序员一样思考。全书分为8章。第1章通对几个经典的算法问题切入,概括了问题解决的基本技巧和步骤。第2章通过实际编写C++代码来解决几个简单的问题,从而让读者进一步体会到问题解决的思路和应用。第3到7章是书中的主体部分,分别探......一起来看看 《像程序员一样思考》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具