touch 8.25 命令詳解


把每個 FILE 文件的訪問和修改時間,更新為當前時間。

在當前目錄下,創建新的空文件。

另請參閱: tty

基本用法     詳細用法

touch one.txt
			

基本語法

touch [OPTION]... FILE...
			

注意:

長選項強製性參數,對於短選項也是必需的。

不存在的 FILE 文件自變量被創建為空,除非 -c 或 -h 被提供。

為 - 的 FILE 自變量字符串會被專門處理,並導緻 touch 更改與標準輸齣關聯的文件時間。

選項參數

參數 EN 解釋 中文翻譯 備注
-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 剖析 STRING 並使用它而不是當前時間
-f (ignored) (忽略)
-h, --no-dereference

affect each symbolic link instead of any referenced file

(useful only on systems that can change the timestamps of a symlink)

影響每個符號鏈接,而不是任何被引用文件

(僅在能更改符號鏈接時間戳的係統上有用)

-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 使用 [[CC]YY]MMDDhhmm[.ss] 而不是當前時間
--time=WORD

change the specified time:

WORD is access, atime, or use: equivalent to -a

WORD is modify or mtime: equivalent to -m

更改指定時間:

WORD 為 access、atime 或 use:等效於 -a

WORD 為 Modify 或 mtime:等效於 -m

--help display this help and exit 顯示此幫助並退齣
--version output version information and exit 輸齣版本信息並退齣

注意: -d 和 -t 選項接受不同的時間日期格式。

基本用法

功能 命令 文字解釋 示例 示例解釋
創建 touch one.txt 在當前目錄下創建新 one.txt 空文件
幫助 touch --help 展示幫助信息
版本 touch --version 展示版本信息

 

版權聲明: 本文為獨傢原創稿件,版權歸 樂數軟件 ,未經許可不得轉載。