Linux命令之cd
cd
命令說明:
切換進入指定目錄
使用方式:
cd [dirName]
cd [相對路徑或絕對路徑]
.代表此層目錄
..代表上層目錄
-代表前一個工作目錄
~代表“目前用戶身份”所在的主文件夾
命令實踐:
[root@yubinghost ~]# cd /home/yubing ? 絕對路徑
[root@yubinghost yubing]# cd. ? ? #cd后沒有加空格,出現錯誤
-bash: cd.: command not found
[root@yubinghost yubing]# cd .
[root@yubinghost yubing]# cd .. ? ? ? ?目前目錄位置的上一層目錄
[root@yubinghost home]# cd - ? 去到前一個工作目錄
/home/yubing
[root@yubinghost yubing]# cd
[root@yubinghost ~]# cd /home/yubing
[root@yubinghost yubing]# cd ~ ? ? ?去到自己的home目錄
[root@yubing /]# cd /home/yubing
[root@yubing yubing]# pwd
/home/yubing
[root@yubing yubing]# cd ../.. ? ? 跳到目前目錄的上上兩層
[root@yubing /]#
轉載于:https://blog.51cto.com/yubing208/1194406
總結
以上是生活随笔為你收集整理的Linux命令之cd的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [Step By Step]SAP HA
- 下一篇: linux 其他常用命令