GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — linux-command/command/cd.md at master · hack121/linux-command

Expand file tree

/

cd.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
36 lines (25 loc) · 1.28 KB
/

cd.md

Copy path

File metadata and controls

36 lines (25 loc) · 1.28 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

cd

切换用户当前工作目录

补充说明

cd命令 用来切换工作目录至dirname。 其中dirName表示法可为绝对路径或相对路径。若目录名称省略,则变换至使用者的home directory(也就是刚login时所在的目录)。另外,~也表示为home directory的意思,.则是表示目前所在的目录,..则表示目前目录位置的上一层目录。

语法

cd (选项) (参数)

选项

-p 如果要切换到的目标目录是一个符号连接,直接切换到符号连接指向的目标目录
-L 如果要切换的目标目录是一个符号的连接,直接切换到字符连接名代表的目录,而非符号连接所指向的目标目录。
- 当仅实用"-"一个选项时,当前工作目录将被切换到环境变量"OLDPWD"所表示的目录。

实例

cd    # 进入用户主目录;
cd ~  # 进入用户主目录;
cd -  # 返回进入此目录之前所在的目录;
cd ..  # 返回上级目录(若当前目录为“/“,则执行完后还在“/";".."为上级目录的意思);
cd ../..  # 返回上两级目录;
cd !$  # 把上个命令的参数作为cd参数使用。
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.