From b7bf31df997cc0597fa68f34cba392baa41ff1cf Mon Sep 17 00:00:00 2001 From: Shaurya Shubham Date: Tue, 1 Oct 2019 18:45:38 +0530 Subject: [PATCH 1/2] Make docs for the cd command ; partially solves #711 --- docs/commands/cd.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/commands/cd.md diff --git a/docs/commands/cd.md b/docs/commands/cd.md new file mode 100644 index 0000000000..1d08beaf33 --- /dev/null +++ b/docs/commands/cd.md @@ -0,0 +1,22 @@ +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. + +Example - + +``` +/home/username> cd Desktop +/home/username/Desktop> now your current directory has been changed +``` +Additionally, `..` takes you to the parent directory - + +``` +/home/username/Desktop/nested/folders> 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. From 417ac4b69e2bf98a35b84afb9e5e86b6c9c6ceaf Mon Sep 17 00:00:00 2001 From: Shaurya Shubham Date: Tue, 1 Oct 2019 19:23:10 +0530 Subject: [PATCH 2/2] Improve cd docs Used format in PR#746 Added another example Removed unnecessary text --- docs/commands/cd.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/commands/cd.md b/docs/commands/cd.md index 1d08beaf33..a227865981 100644 --- a/docs/commands/cd.md +++ b/docs/commands/cd.md @@ -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> +```