Improve cd docs

Used format in PR#746
Added another example
Removed unnecessary text
This commit is contained in:
Shaurya Shubham 2019-10-01 19:23:10 +05:30 committed by GitHub
parent b7bf31df99
commit 417ac4b69e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,22 +1,25 @@
If you don't know about it alreaday, the `cd` command is very simple. It stands for 'change directory' and it does exactly that. It changes the current directory that you are in to the one specified.
# cd
Example -
If you don't know about it already, the `cd` command is very simple. It stands for 'change directory' and it does exactly that. It changes the current directory that you are in to the one specified. If no directory is specified, it takes you to the home directory. Additionally, `..` takes you to the parent directory
```
## Examples -
```shell
/home/username> cd Desktop
/home/username/Desktop> now your current directory has been changed
```
Additionally, `..` takes you to the parent directory -
```
```shell
/home/username/Desktop/nested/folders> cd ..
/home/username/Desktop/nested>cd ..
/home/username/Desktop/nested> cd ..
/home/username/Desktop> cd ../Documents/school_related
/home/username/Documents/school_related> cd ../../..
/home/>
```
And `/` takes you to the root of the filesystem, which is `/` on Linux and MacOS, and `C:\` on Windows.
If no directory is specified, it takes you to the home directory, which is `/home/your_username` on MacOS and Linux systems and `C:\Users\Your_username` on Windows.
```shell
/home/username/Desktop/super/duper/crazy/nested/folders> cd
/home/username> cd ../../usr
/usr> cd
/home/username>
```