网站你懂我意思正能量晚上在线观看不用下载免费魅族,重庆网站建设及推广公司,图书馆网站建设好处,网站域名申请步骤1. Linux文件的时间Linux下文件时间主要有下面三种#xff1a;1.1 modification time(mtime)文件修改时间#xff0c;即文件内容的修改时#xff0c;更新这个时间#xff0c;不包括文件权限和属性的修改。使用ls -l查看#xff0c;默认显示时间为mtime$ ls -l uconv.h-rw-…1. Linux文件的时间Linux下文件时间主要有下面三种1.1 modification time(mtime)文件修改时间即文件内容的修改时更新这个时间不包括文件权限和属性的修改。使用ls -l查看默认显示时间为mtime$ ls -l uconv.h-rw-rw-r-- 1 work work 1808 Jul 23 2013 uconv.h1.2 status time(ctime)文件状态status的修改时间如文件的权限和属性修改时更新这个时间。使用 ls --timectime 查看$ ls -l --timectime uconv.h-rw-rw-r-- 1 work work 1808 Jul 23 2013 uconv.h1.3 access time(atime)文件访问时间当文件内容被获取时更新这个时间。使用 ls --timeactime 查看$ ls -l --timeatime uconv.h-rw-rw-r-- 1 work work 1808 Dec 12 2013 uconv.h2. 修改文件的时间如果需要修改上述三个时间使用touch命令来修改。touch filename ,如果文件不存在则新建一个文件。$ touch --helpUsage: touch [OPTION]... FILE...Update the access and modification times of each FILE to the current time.-a change only the access time修改访问时间-c, --no-create do not create any files修改文件三个时间不存在则不创建-d, --dateSTRING parse STRING and use it instead of current time指定时间代替当前时间-f (ignored)-m change only the modification time修改mtime-r, --referenceFILE use this files times instead of current time-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time指定修改时间例如$ touch -d 2 days ago uconv.h$ ll uconv.h ; ll --timeatime uconv.h ; ll --timectime uconv.h ;-rw-rw-r-- 1 work work 1808 Jun 13 18:17 uconv.h-rw-rw-r-- 1 work work 1808 Jun 13 18:17 uconv.h-rw-rw-r-- 1 work work 1808 Jun 15 18:17 uconv.h将mtime和atime修改为两天前ctime没变。$ touch -t 201406142020 uconv.h$ ll uconv.h ; ll --timeatime uconv.h ; ll --timectime uconv.h ;-rw-rw-r-- 1 work work 1808 Jun 14 20:20 uconv.h-rw-rw-r-- 1 work work 1808 Jun 14 20:20 uconv.h-rw-rw-r-- 1 work work 1808 Jun 15 18:23 uconv.hatime和mtime都变了但是ctime变成了当前时间。使用cp命令-a保持原属性。$ cp -a uconv.h uconv.h1$ ll uconv.h1 ; ll --timeatime uconv.h1 ; ll --timectime uconv.h1 ;-rw-rw-r-- 1 work work 1808 Jun 14 20:20 uconv.h1-rw-rw-r-- 1 work work 1808 Jun 15 18:25 uconv.h1-rw-rw-r-- 1 work work 1808 Jun 15 18:27 uconv.h1mtime和atime都保持原文件不变但是ctime变成当前时间