linux下的cd命令

切换到某个目录

[plain]  view plain copy
  1. #查看当前所在路径  
  2. bixiaopeng@bixiaopengtekiMacBook-Pro ~$ pwd  
  3. /Users/bixiaopeng  
  4. #使用命令:cd 目录路径  
  5. bixiaopeng@bixiaopengtekiMacBook-Pro ~$ cd apktool  
  6. #查看切换后的路径  
  7. bixiaopeng@bixiaopengtekiMacBook-Pro apktool$ pwd  
  8. /Users/bixiaopeng/apktool  


切换到主目录

[plain]  view plain copy
  1. #方法一:cd   
  2. bixiaopeng@bixiaopengtekiMacBook-Pro apktool$ cd  
  3. bixiaopeng@bixiaopengtekiMacBook-Pro ~$ pwd  
  4. /Users/bixiaopeng  
  5. #方法二:cd ~  
  6. bixiaopeng@bixiaopengtekiMacBook-Pro ~$ cd apktool  
  7. bixiaopeng@bixiaopengtekiMacBook-Pro apktool$ cd ~  
  8. bixiaopeng@bixiaopengtekiMacBook-Pro ~$ pwd  
  9. /Users/bixiaopeng  


切换到上一级目录

[plain]  view plain copy
  1. bixiaopeng@bixiaopengtekiMacBook-Pro ~$ cd apktool/framework/  
  2. bixiaopeng@bixiaopengtekiMacBook-Pro framework$ pwd  
  3. /Users/bixiaopeng/apktool/framework  
  4. bixiaopeng@bixiaopengtekiMacBook-Pro framework$ cd ..  
  5. bixiaopeng@bixiaopengtekiMacBook-Pro apktool$ pwd  
  6. /Users/bixiaopeng/apktool  

切换到当前目录之前的目录

[plain]  view plain copy
  1. bixiaopeng@bixiaopengtekiMacBook-Pro apktool$ cd -  
  2. /Users/bixiaopeng/apktool/framework  
  3. bixiaopeng@bixiaopengtekiMacBook-Pro framework$ pwd  
  4. /Users/bixiaopeng/apktool/framework  


切换到上两级目录

[plain]  view plain copy
  1. bixiaopeng@bixiaopengtekiMacBook-Pro framework$ cd ../..  
  2. bixiaopeng@bixiaopengtekiMacBook-Pro ~$ pwd  

你可能感兴趣的:(linux下的cd命令)