linux mkdir基礎命令總結

來源:互聯網
上載者:User

標籤:linux mkdir

使用者命令  mkdir

描述:

    通過mkdir命令可以實現在指定位置建立檔案夾或者目錄,要建立檔案夾或目錄的使用者必須對所建立目錄的父目錄具有寫的許可權,並且建立的目錄不能與父目錄重名(嚴格區分大小寫)

命令   mkdir – 建立目錄 (全名:make directories )

       mkdir [參數]... 目錄名稱...

參數

  -m  --mode 設定目前許可權

  -p   --parents 可以是一個路徑的名稱。此時若路徑中的目錄不存在,加上此選項後系統自動建立那些尚不存在的目錄,即一次可以建立多個目錄

  -v   --verbose 每次建立新目錄都顯示資訊

      --help     顯示此協助資訊並退出

      --version   輸出版本資訊並退出

命令執行個體:

執行個體1: 在根目錄/下建立一個命名為51cto的空目錄

命令:mkdir 51cto

[[email protected] ~]# mkdir 51cto

查看命令:ls(只顯示目錄)或者ll(顯示目錄的詳細資料,許可權,建立使用者、時間等)

[[email protected] ~]# mkdir 51cto
[[email protected] ~]# ls
51cto  anaconda-ks.cfg  install.log  install.log.syslog  test  yema1
[[email protected] ~]# ll
total 60
drwxr-xr-x. 2 root root  4096 Dec 26 14:51 51cto
-rw-------. 1 root root  1295 Dec 25 23:32 anaconda-ks.cfg
-rw-r--r--. 1 root root 28865 Dec 25 23:32 install.log
-rw-r--r--. 1 root root  7572 Dec 25 23:30 install.log.syslog
drwxr-xr-x. 2 root root  4096 Dec 26 09:51 test
drwxr-xr-x. 3 root root  4096 Dec 26 09:45 yema1

執行個體2 :使用-p參數在根目錄/中建立遞迴目錄 auto/auto2

命令:mkdir –p  auto/auto2

[[email protected] ~]# mkdir -p auto/auto2

使用ls和ll查看

[[email protected] ~]# ls
51cto  anaconda-ks.cfg  auto  install.log  install.log.syslog 
[[email protected] ~]# ll
total 64
drwxr-xr-x. 2 root root  4096 Dec 26 14:51 51cto
-rw-------. 1 root root  1295 Dec 25 23:32 anaconda-ks.cfg
drwxr-xr-x. 3 root root  4096 Dec 26 14:54 auto
-rw-r--r--. 1 root root 28865 Dec 25 23:32 install.log
-rw-r--r--. 1 root root  7572 Dec 25 23:30 install.log.syslog


執行個體3:建立目錄是都顯示資訊

命令 mkdir –v auto1

[[email protected] ~]# mkdir -v auto1
mkdir: created directory `auto1‘


錯誤之處還請指正!

本文出自 “邁進IT” 部落格,請務必保留此出處http://518443.blog.51cto.com/508443/1596235

linux mkdir基礎命令總結

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.