Linux命令分析: touch
来源:互联网 发布:whatsapp软件下载 编辑:程序博客网 时间:2024/06/01 16:53
用途:更改文件的时间戳,常用来创建新的空文件
用法:touch 选项... 文件...
touch命令可用来更改文件的atime和mtime到当前时间,如果touch命令后接的文件不存在,则会建立一个该文件名的空文件(除非有-c或-h参数)
参数:
-a 只更改atime
-c --no-create 不创建任何文件
-d --date=STRING 分析-d后接的字符串并以之替代当前时间(mtime和atime变成指定时间,atime为当前时间)
-f 此参数不予处理,是用来解决不同版本BSD里touch指令兼容的问题
-h --no-dereference 仅影响链接文件自身的时间戳,但不影响所链接到的文件的时间戳
-m 只更改mtime
-r --reference=FILE 用参考文件的时间来更改指定文件的时间(mtime和atime变成参考文件时间,atime为当前时间)
-t STAMP 使用-t后接参数所指定的时间来更改文件时间(mtime和atime变成STAMP时间,atime为当前时间)
典型用法:
1.创建一个新文件
touch 文件名
2.更改文件时间为2017年9月1日12点00分
touch -d "2017-09-01 12:00" 文件名
touch -t 1709011200 文件名
3.更改文件的时间到与参考文件相同
touch -r 参考文件 要更改的文件
阅读全文
0 0
- Linux命令分析: touch
- linux命令-touch命令
- linux命令 -- touch 命令
- Linux命令:touch使用方法
- linux touch 命令详解
- Linux命令touch
- linux :touch 命令
- linux touch命令
- linux touch命令
- linux命令之--touch
- Linux touch命令
- Linux命令:touch
- linux touch 命令
- Linux命令:touch使用方法
- linux touch 命令
- Linux touch命令
- Linux命令touch
- Linux命令:touch
- 快速破解ViEmu软件
- 奥威Power-BI 集团BI案例:城投集团-集团管理驾驶舱
- ASH ORA-01843: 无效的月份
- oracle中使用jobs时出现ORA-06553错误
- Arduino可穿戴教程之第一个程序——Blink(一)
- Linux命令分析: touch
- Linux如何查看JDK的安装路径
- hdu 5936 二分好题 2016年中国大学生程序设计竞赛(杭州)
- 本机上访问tomcat项目可以,局域网内的其他机器访问不到项目
- maven 安装感想、 配置、构建一个maven projec
- java的8大排序
- matlab cell数组的用法
- unsigned int mysql中的unsigned
- C++ Http请求中文传参乱码问题