This post is written by YoungJ-Baek

1. Preface

If you are using a command line tool environment, you should know cd command to change current directory. In this post, usage and options of cd will be described.

2. cd

2.1. Command

cd is the abbreviation of Change Directory. Usage is simple, but you need to know more about directory. For more details, please take a look at chapter 2.2.

Command

$ cd [directory]

2.2. Directory

You can use both relative and absolute path. Also, you can use shortcut for some special path for directory argument.

Directory Description Example
. Move to the current directory ~/Desktop/YoungJ-Baek.githubio & cd .
~/Desktop/YoungJ-Baek.githubio &
.. Move to the parent directory ~/Desktop/YoungJ-Baek.githubio & cd ..
~/Desktop &
~ Move to the home directory ~/Desktop/YoungJ-Baek.githubio & cd ~
~ &
- Go back to the previous directory ~ & cd -
~/Desktop
~/Desktop/YoungJ-Baek.githubio &
/ Move to the root directory ~/Desktop/YoungJ-Baek.githubio & cd /
/ &

Leave a comment