1.2 KiB
1.2 KiB
title |
---|
Bash cd |
Bash command: cd
Change Directory to the path specified, for example cd projects
.
There are a few really helpful arguments to help with this:
.
refers to the current directory, such as./projects
..
can be used to move up one folder, usecd ..
, and can be combined to move up multiple levels../../my_folder
-
takes you back to the previous directory you were working on. For example,cd -
/
is the root of your system to reach core folders, such assystem
,users
, etc.~
is the home directory, usually the path/users/username
. Move back to folders referenced relative to this path by including it at the start of your path, for example~/projects
.-
can be used to move to the previous directory. For example, you are in/A
, then cd to/B
, usecd -
and you are back to/A
~[number]
will cd to that entry from the output ofdirs
directories can be pushed on poped to the 'dirs' stack usingpushd
andpopd
respectively.- Typing only
cd
will move to the home directory works same ascd ~
- Typing 'pwd' will show you which directory you are currently working in.