3

Linux常用命令-3:touch

 1 year ago
source link: https://xugaoxiang.com/2022/06/01/linux-cmds-3-touch/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

touch 命令有两个功能,一是创建新的空文件;二是改变已有文件的时间戳属性。在修改文件时间属性时,用户必须是文件的属主,或拥有写文件的访问权限。

语法格式:touch [参数] [文件]

cfe6a0a4cfec6114.png
# 创建文件test.py
touch test.py

# 也可以批量创建,要求文件名有一定的规律,比如test1.py、test2.py、test3.py
touch test{1..3}.py

# 修改文件的访问时间,可以通过命令stat来查看
touch -a test.py

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK