Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

day 8 - linux 命令 : touch #77

Open
hoperyy opened this issue Oct 12, 2017 · 0 comments
Open

day 8 - linux 命令 : touch #77

hoperyy opened this issue Oct 12, 2017 · 0 comments

Comments

@hoperyy
Copy link
Owner

hoperyy commented Oct 12, 2017

day 8 - linux 命令 : touch

touch 命令用来:(1)新建一个文件;(2)修改文件时间戳

语法

touch [选项] 文件……

选项

  • -f

    仅负责解决 BSD 版本 touch 指令的兼容性问题

  • -r

    touch -r a bb 文件的时间戳修改成 a 文件的时间戳

  • -t

    指定时间戳

实例

  • 创建不存在的文件

    touch a b

  • 更新 log.loglog2.log 的时间戳相同

    touch -r log2.log log.log

  • 设定文件的时间戳

    touch -t 201211142234.50 log.log

    格式:

    [[CC]YY]MMDDhhmm[.SS]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant