Linux 下修改文件创建时间
2013-02-27 11:21
267 查看
在linux下编译文件,源文件的时间戳很多都是错的,好吧,开始修改文件的时间戳
google了一下,发现用touch命令可行,以前一直以为touch命令就是为了创建文件的
由于很多文件的时间戳都坏掉了,和find命令组合使用
man touch 手册页
NAME
touch - change file timestamps
SYNOPSIS
touch [OPTION]... FILE...
-a change only the access time
-c, --no-create
do not create any files
-d, --date=STRING
parse STRING and use it instead of current time
-f (ignored)
-m change only the modification time
-r, --reference=FILE
use this file's times instead of current time
-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time
--time=WORD
change the specified time: WORD is access, atime, or use: equiv‐
alent to -a WORD is modify or mtime: equivalent to -m
--help display this help and exit
--version
output version information and exit
DATE STRING
The --date=STRING is a mostly free format human readable date string
such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or
even "next Thursday". A date string may contain items indicating cal‐
endar date, time of day, time zone, day of week, relative time, rela‐
tive date, and numbers. An empty string indicates the beginning of the
day. The date string format is more complex than is easily documented
here but is fully described in the info documentation.
google了一下,发现用touch命令可行,以前一直以为touch命令就是为了创建文件的
由于很多文件的时间戳都坏掉了,和find命令组合使用
find ./ -exec touch -t 201302271109 {} \;
man touch 手册页
NAME
touch - change file timestamps
SYNOPSIS
touch [OPTION]... FILE...
-a change only the access time
-c, --no-create
do not create any files
-d, --date=STRING
parse STRING and use it instead of current time
-f (ignored)
-m change only the modification time
-r, --reference=FILE
use this file's times instead of current time
-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time
--time=WORD
change the specified time: WORD is access, atime, or use: equiv‐
alent to -a WORD is modify or mtime: equivalent to -m
--help display this help and exit
--version
output version information and exit
DATE STRING
The --date=STRING is a mostly free format human readable date string
such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or
even "next Thursday". A date string may contain items indicating cal‐
endar date, time of day, time zone, day of week, relative time, rela‐
tive date, and numbers. An empty string indicates the beginning of the
day. The date string format is more complex than is easily documented
here but is fully described in the info documentation.
相关文章推荐
- Linux 修改文件时间及创建新文件
- linux下文件的创建时间、访问时间、修改时间和改变时间
- 【linux】如何查看文件的创建、修改时间
- linux下文件的创建时间、访问时间、修改时间和改变时间
- 使用golang获取linux上文件的访问/创建/修改时间
- Linux目录与文件创建时间 / 修改时间 / 访问时间 / 指令 touch(鸟哥的Linux私房菜基础学习篇第三版-第七章)
- Linux下修改文件创建时间(修改文件更改时间)
- Linux中进文件以及创建文件需要的权限,文件中ACM三个时间代表的含义以及touch如何修改时间
- linux下文件的创建时间、访问时间、修改时间和改变时间
- Linux每天一点修改文件时间或创建新文件
- Linux下对文件创建、修改、访问时间的一些操作
- linux查看文件创建修改时间,如何显示年份
- linux下文件的创建时间、访问时间、修改时间和改变时间
- Linux touch --创建文件或修改文件时间
- Linux下修改文件创建时间(修改文件更改时间)
- linux 下文件的创建时间、访问时间、修改时间和改变时间
- linux创建、进入、修改目录或者文件权限 ‘ACM’时间是什么?怎么修改?
- linux下文件的创建时间、访问时间、修改时间和改变时间
- Linux系统下查看某文件修改的时间戳
- linux 下查看文件修改时间 等