linux--文件時間
来源:互联网 发布:tv霸网络电视在线直播 编辑:程序博客网 时间:2024/05/17 20:28
linux下的文件有3個時間屬性:
access time (atime): 对文件访问的时间
modification time (mtime): 文件内容修改的时间
change time (ctime): 文件属性(权限,屬主)修改的时间。
注:一般mtime改变时ctime也会改变。 但ctime改變時atime不同步改變。
可以使用stat命令查看上述的幾個時間。touch可以改變檔案的時間屬性,ls -l
可以顯示檔案的時間記錄。
touch: 可以使用該命令修改文件的上述三個時間屬性(執行touch -d/touch -t更改時間會影響atime和mtime)
結構語法:
touch [-acfm]
[-r reference-file] [--file=reference-file]
[-t MMDDhhmm[[CC]YY][.ss]]
[-d time] [--date=time] [--time={atime,access,use,mtime,modify}]
[-no-create] [--help] [--version]
file1 [file2 ...]
參數:a 改变档案的读取时间记录。
m 改变档案的修改时间记录。
c 假如目的档案不存在,不会建立新的档案。与 --no-create 的效果一样。
f 不使用,是为了与其他 unix 系统的相容性而保留。
r 使用参考档的时间记录,与 --file 的效果一样。
d 设定时间与日期,可以使用各种不同的格式。
t 设定档案的时间记录,格式与 date 指令相同。
--no-create 不会建立新档案。
--help 列出指令格式。
--version 列出版本讯息。
*************************************************************
touch -d 和 date -t 的用法相同。
- linux--文件時間
- linux文件
- Linux 文件
- Linux文件
- linux文件
- linux文件
- Linux文件
- Linux文件
- Linux 文件
- linux文件
- linux 文件
- Linux文件
- Linux文件
- linux 文件
- Linux 文件
- Linux文件
- linux 文件
- linux文件
- Asp.net中,从弹出窗体取选择值
- 基本排序算法
- Asp.net与SQL一起打包部署安装
- [数据库连接字符串] Access 连接字符串(转)
- #ifdef的嵌套使用
- linux--文件時間
- Oracle中关于处理小数点位数的几个函数,取小数位数,Oracle查询函数
- lighttpd 配置全接触(1)——Lighttpd core
- C#对Web.config的读写操作
- 如何设置视频采集的制式
- 序
- Android adb shell 命令
- eclipse调试技巧
- linux ln 命令的使用