當前位置:生活全書館 >

IT科技

> linux開啟記事本命令

linux開啟記事本命令

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開啟記事本命令

標籤: 記事本 命令 linux
  • 文章版權屬於文章作者所有,轉載請註明 https://shqsg.com/dianzi/o96l4y.html