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的时间已修改为当前系统时间。


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

查看所有标签

猜你喜欢:

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

C语言名题精选百则技巧篇

C语言名题精选百则技巧篇

冼镜光 / 机械工业出版社 / 2005-7 / 44.00元

《C语言名题精选百则》(技巧篇)收集了100则C语言程序设计题,共分9类。第一类比较简单,主要希望读者了解到《C语言名题精选百则》(技巧篇)的题目、解法与其他书籍之间的差异;第二至六类分别是关于数字、组合数学或离散数学、查找、排序、字符串等方面的题目;第七类列出了一些不太容易归类的题目,如Buffon丢针问题、Dijkstra的三色旗问题等;第八类则收录了一些有趣的、娱乐性的题目,如魔方阵等;第九......一起来看看 《C语言名题精选百则技巧篇》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具