009 檔案和目錄操作命令 rmdir

2021-10-05 20:13:23 字數 674 閱讀 9400

rmdir

#刪除空目錄(目錄沒有任何檔案)

[root@db01 ~]

# mkdir /root/chenliang #建立/root/chenliang目錄

[root@db01 ~]

# ls -ld /root/chenliang/ #檢視是否建立成功

drwxr-xr-x 2 root root 4096 jul 8 09:48 /root/chenliang/

[root@db01 ~]

# ls /root/chenliang/ #檢視/root/chenliang目錄下有什麼檔案

[root@db01 ~]

#[root@db01 ~]

# ls -a /root/chenliang/ #檢視/root/chenliang目錄下預設存在的隱藏檔案...

[root@db01 ~]

#[root@db01 ~]

# rmdir /root/chenliang/ #刪除/root/chenliang空目錄

002 檔案和目錄操作命令 touch

touch 建立檔案 a 更新檔案的訪問 acces 時間,同時檔案的改變 change 時間也會同時更新 m 更新檔案的修改 modify 時間,同時檔案的改變 change 時間也會同時更新 c 更新檔案的改變 change 時間 範例1 建立 chenliang.txt檔案 root db01...

007 檔案和目錄操作命令 mv

mv 移動檔案或目錄 i 如果目的檔案已存在,詢問是否覆蓋。在別名中可以看到已被系統定義,可以用alis mv來檢視 t 反轉,把源與目標反轉,詳見範例2 範例1 建立 lili chenliang目錄,然後把 lili chenliang目錄移動到 tmp目錄下 root db01 mkdir l...

011 檔案和目錄操作命令 basename

basename 取檔名 linux下一切皆檔案 範例1 顯示 etc services中的services root db01 ll etc services 檢視 etc services檔案是否存在 rw r r 1 root root 641020 oct 2 2013 etc servic...