fix(guide): simplify directory structure

This commit is contained in:
Mrugesh Mohapatra
2018-10-16 21:26:13 +05:30
parent f989c28c52
commit da0df12ab7
35752 changed files with 0 additions and 317652 deletions

View File

@ -0,0 +1,11 @@
---
title: Terminal/Command Prompt
---
# Terminal/Command Prompt

View File

@ -0,0 +1,89 @@
---
title: Mac OS Terminal
---
# Using the Terminal in Mac OS
Most of the time users interact through a Graphical User Interface to interact with the computer. You use the mouse to point and click to open, move, or create new files or open applications. But, you can also use the Terminal Application to interact with your machine through written commands. When you use the terminal, it allows you to dig deeper and customize in a way not possible through the GUI.
### Opening the Terminal and Navigating Directories
Your terminal exists in the Applications directory. Open your Terminal app. You should see a prompt in the terminal window. it shoudl have the computer's name (ABC's Macbook), followed by the User name (ABC), and then a '$.' If you are in the root directory, the last character will be a '#.'
To see what directory you are working in, just type the command
```pwd```
pwd stands for "Print Working Directory." Directory is another word for folder.
If you want to list the contents of your directory use the command:
```ls```
To switch to a new directory you use the command:
```cd```
which stands for change directory.
Here is a list of common commands:
Command | Usage
------------ | -------------
pwd | Print Working Directory (Where Am I? )
ls | List contents of current directory
mkdir | Create a new directory
touch | Create a new file
cp| Copy a file
rm | Remove a file
rm -rf | Remove a directory
### Usage Examples
Some of the aforementioned commands aren't clear without examples. Below are a few usage examples to help provide you with some context.
#### Making a Directory
```mkdir #YOUR-NEW-FOLDER-NAME-HERE```
#### Making a File
``` touch YOUR-FILE-NAME.JS```
You can make a file with any extension you choose. As long as it is in an a format accepted by the folder or machine.
#### Copying a File
Use the following syntax to copy a file from the terminal:
**cp _source_ _destination_**
For example, if we have a file, _'test.txt'_ that is stored in our _/Desktop_ directory and we want to copy it to the _/Documents_ folder, our command would look like this:
cp ~/Desktop/test.txt ~/Documents
#### Deleting a File
Use the following syntax to delete a file
**rm _#PATH_TO_FILE_**
#### Detect which process is using the port you want to use
``` lsof -i :<PORT> ```
#### Terminate the process which uses the port you want to use
``` kill <PID> ```
# iTerm2
iTerm2 is an alternative to the legacy terminal in Mac OS. iTerm2 brings some new features such as:
* Split Panes
* Hotkey Window
* Search
* Autocomplete
* Paste history
* Configurability
* and many [more](https://www.iterm2.com/features.html)
Just download iTerm2 from the official [website](https://www.iterm2.com/downloads.html). Additional documentation can be found [here](https://www.iterm2.com/documentation.html).

View File

@ -0,0 +1,55 @@
---
title: Windows Command Prompt
---
# Using the Command Prompt in Windows
Windows, MacOS and Linux have command line interfaces. Windows' default command line is the command prompt. The command prompt allows users to use their computer without pointing and clicking with a mouse. The command prompt is a black screen where users type commands to use their computer. The same tasks that can be done by pointing and clicking with a mouse can also be done with the command prompt. The difference is that many tasks such as creating folders and deleting files can be done faster in the command prompt. Also, it allows users to configure their computer and run programs that they otherwise could not do by pointing and clicking.
## Opening the Command Prompt
To access the command prompt, click the windows start menu on the Desktop tool bar (you can also press the windows button on your keyboard) and type `cmd` and hit `enter`. The command prompt will appear, it will display some text like to following below:
```
C:\Users\YourUserName>
```
## Navigating Directories (Moving through folders)
`C:\Users\YourUserName` is called your current working directory (directory is another way to say folder). It is like a street address that tells you where you are on your computer. The current working directory can be a guide as you navigate through your computer. On the right of the `>` we can type `cd`, which stands for Change Directory, and the name of a directory that you want to navigate to. In this case we will type `Documents`. Enter `cd Documents` and your current working directory should look like the following:
```
C:\Users\YourUserName\Documents>
```
To go back one directory type and enter `cd..`. Your current working directory should return to this:
```
C:\Users\YourUserName>
```
With the `cd` and `cd ..` commands you can move back and forth through directories. This might seem very basic at first but as you learn more commands the command prompt will become a very useful and efficient tool.
## Here is a list of common commands:
| Command | Description |
|---------|--------------|
|`help` |Lists commands that can be used|
| `dir` |Lists the current directories contents|
|`dir /a` |Shows hidden files|
| `mkdir` |Creates a new directory|
| `rmdir` |Deletes a directory (if empty)|
| `rmdir /s`|Deletes a folder and its contents
| `cls` |Clears the command prompt screen
| `exit`|Closes the command prompt
## Usage Examples:
#### Making a Directory
```
mkdir name_of_the_directory_you_want_to_make
```
#### Getting Info on a Command
```
your_command /?
```
#### Deleting a File and Contents
```
rm /s name_of_directory_you_want_to_delete
```
## Useful tips:
- The command `Ipconfig` shows your computer's ip address
- If you type part of a directory's name and hit the `tab` key the command prompt will autocomplete it and if you hit the `tab` key repeatedly it will cycle through directories that start with the same letter
- You can use other shells or tools such as git bash or cmder to add more commands and functionality to your command prompt
- Some tasks require you to run the command prompt as an administrator you clicking the windows button and typing `cmd admin` and hit the `enter` key
- If you know the path to a file or directory can type `cd PATH_TO_YOUR_DIRECTORY` instead of changing directories several times to get to a directory or file
- When you hit the up arrow key your previously entered command will appear and if you hit it repeatedly it will cycle through all of your previously entered commands