ch3- 文件系統(tǒng)中跳轉

幾個命令

  • cd -change directory
  • pwd -Pring name of current Working directory
  • ls -List directory contents

這幾個命令都很容易理解。

絕對路徑與相對路徑

An absolute pathname begins with the root directory and follows the tree branch by branch until the path to the desired directory or file is completed.
Where an absolute pathname starts from the root directory and leads to its destination, a relative pathname starts from the working directory.
對于絕對路徑,我們要列出整個的的文件路徑進入,如:

cd /usr/local

而相對路徑則是相對于當前工作目錄而言,用...來操作,如

#當前目錄 `/usr/local`,要進入`/usr` 有兩種方法
cd /usr #絕對路徑
cd ..     #相對路徑

在進入子目錄的時候,比如當前是/usr,進入子文件夾

cd ./local  

通常./是可以省略的,

cd local

有用的快捷鍵

cd            #到home directory
cd -          #到上一個工作路徑
cd ~user_name #到某個用戶的home directory
ls -a         #連隱藏文件也列出來
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容