Add usage and example (#26972)
parent
52d0ff5319
commit
8da12ac3ab
|
@ -6,8 +6,13 @@ title: Bash cd
|
||||||
|
|
||||||
**Change Directory** to the path specified, for example `cd projects`.
|
**Change Directory** to the path specified, for example `cd projects`.
|
||||||
|
|
||||||
There are a few really helpful arguments to help with this:
|
### Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd [dir]
|
||||||
|
```
|
||||||
|
|
||||||
|
There are a few really helpful arguments to help with this:
|
||||||
- `.` refers to the current directory, such as `./projects`
|
- `.` refers to the current directory, such as `./projects`
|
||||||
- `..` can be used to move up one folder, use `cd ..`, and can be combined to move up multiple levels `../../my_folder`
|
- `..` can be used to move up one folder, use `cd ..`, 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 -`
|
- `-` takes you back to the previous directory you were working on. For example, `cd -`
|
||||||
|
@ -18,5 +23,12 @@ There are a few really helpful arguments to help with this:
|
||||||
- Typing only `cd` will move to the home directory works same as `cd ~`
|
- Typing only `cd` will move to the home directory works same as `cd ~`
|
||||||
- Typing 'pwd' will show you which directory you are currently working in.
|
- Typing 'pwd' will show you which directory you are currently working in.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
Change directory to `projects` folder:
|
||||||
|
```bash
|
||||||
|
cd projects
|
||||||
|
```
|
||||||
|
|
||||||
### More Information:
|
### More Information:
|
||||||
* [Wikipedia](https://en.wikipedia.org/wiki/Cd_(command))
|
* [Wikipedia](https://en.wikipedia.org/wiki/Cd_(command))
|
||||||
|
|
Loading…
Reference in New Issue