幾個(gè)命令
- cd -change directory
- pwd -Pring name of current Working directory
- ls -List directory contents
這幾個(gè)命令都很容易理解。
絕對(duì)路徑與相對(duì)路徑
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.
對(duì)于絕對(duì)路徑,我們要列出整個(gè)的的文件路徑進(jìn)入,如:
cd /usr/local
而相對(duì)路徑則是相對(duì)于當(dāng)前工作目錄而言,用.
和..
來(lái)操作,如
#當(dāng)前目錄 `/usr/local`,要進(jìn)入`/usr` 有兩種方法
cd /usr #絕對(duì)路徑
cd .. #相對(duì)路徑
在進(jìn)入子目錄的時(shí)候,比如當(dāng)前是/usr
,進(jìn)入子文件夾
cd ./local
通常./
是可以省略的,
cd local
有用的快捷鍵
cd #到home directory
cd - #到上一個(gè)工作路徑
cd ~user_name #到某個(gè)用戶的home directory
ls -a #連隱藏文件也列出來(lái)