開心生活站

位置:首頁 > IT科技 > 

linux打開記事本命令

IT科技1.6W

linux系統下打開筆記本命令是:touch命令。

1、touch命令功能:

一是用於把已存在文件的時間標籤更新爲系統當前的時間(默認方式),它們的數據將原封不動地保留下來;二是用來創建新的空文件。

2、語法:

touch(選項)(參數)

3、參數:

-a:或--time=atime或--time=access或--time=use 只更改存取時間;

-c:或--no-create 不建立任何文件;

-d:使用指定的日期時間,而非現在的時間;

-f:此參數將忽略不予處理,僅負責解決BSD版本touch指令的兼容性問題;

-m:或--time=mtime或--time=modify 只更該變動時間;

-r:把指定文件或目錄的日期時間,統統設成和參考文件或目錄的日期時間相同;

-t:使用指定的日期時間,而非現在的時間;

--help:在線幫助;--version:顯示版本信息。

舉例:

使用範例:

實例一:創建不存在的文件

命令:

touch log2012.log log2013.log

輸出:

[root@localhost test]# touch log2012.log log2013.log

[root@localhost test]# ll

-rw-r--r-- 1 root root    0 10-28 16:01 log2012.log

-rw-r--r-- 1 root root    0 10-28 16:01 log2013.log

如果log2014.log不存在,則不創建文件

[root@localhost test]# touch -c log2014.log

[root@localhost test]# ll

-rw-r--r-- 1 root root    0 10-28 16:01 log2012.log

-rw-r--r-- 1 root root    0 10-28 16:01 log2013.log

linux打開記事本命令