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


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

查看所有标签

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

深入Linux内核架构

深入Linux内核架构

Wolfgang Mauerer / 郭旭 / 人民邮电出版社 / 201005 / 149.00元

众所周知,Linux操作系统的源代码复杂、文档少,对程序员的要求高,要想看懂这些代码并不是一件容易事。本书结合内核版本2.6.24源代码中最关键的部分,深入讨论Linux内核的概念、结构和实现。具体包括进程管理和调度、虚拟内存、进程间通信、设备驱动程序、虚拟文件系统、网络、时间管理、数据同步等方面的内容。本书引导你阅读内核源代码,熟悉Linux所有的内在工作机理,充分展现Linux系统的魅力。 ......一起来看看 《深入Linux内核架构》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

SHA 加密
SHA 加密

SHA 加密工具

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

在线XML、JSON转换工具