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


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

查看所有标签

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

UNIX网络编程 卷1:套接字联网API(第3版)

UNIX网络编程 卷1:套接字联网API(第3版)

[美]W. 理查德•史蒂文斯(W. Richard Stevens)、比尔• 芬纳(Bill Fenner)、安德鲁 M. 鲁道夫(Andrew M. Rudoff) / 匿名 / 人民邮电出版社 / 2014-6-1 / 129.00

《UNIX环境高级编程(第3版)》是被誉为UNIX编程“圣经”的Advanced Programming in the UNIX Environment一书的第3版。在本书第2版出版后的8年中,UNIX行业发生了巨大的变化,特别是影响UNIX编程接口的有关标准变化很大。本书在保持前一版风格的基础上,根据最新的标准对内容进行了修订和增补,反映了最新的技术发展。书中除了介绍UNIX文件和目录、标准I/......一起来看看 《UNIX网络编程 卷1:套接字联网API(第3版)》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

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

多种字符组合密码

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

HSV CMYK互换工具