簡明Linux命令列筆記:cd

來源:互聯網
上載者:User
文章目錄
  • 參數
  • 選項
  • 樣本
  • Tips

切換到另一個工作目錄

cd [options] [directory]

 

參數

directory為指定的目錄路徑名,如果不帶任何參數,cd就把主目錄作為工作目錄

 

選項

                    無選項,切換到主目錄

..                  切換到上級目錄

../..               切換到上級目錄的上級目錄

cd -              切換到上次使用的工作目錄

 

樣本cd
$ pwd/home/siu/work/home$ cd$ pwd/home/siu

第一次pwd確認我現在的目錄,然後cd切換到主目錄,再一次pwd確認

 

cd 任意目錄
$ cd /tmp$ pwd/tmp

直接切換到/tmp目錄

 

cd..
$ cd ..$ pwd/

切換到上級目錄,此處的上級目錄就是根目錄

 

cd -
$ cd /home/siu/work$ cd -/

切換到上次所在目錄

 

cd ../..
$ cd /home/siu/work$ cd ../..$ pwd/home

多級返回到父目錄

 

Tips

其實這裡的選項是比較常用的,並不存在與標準文檔中,要查看具體資訊請翻閱man頁、info頁、help頁……至於麼,不就是切換個目錄

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.