added examples, made explanations clearer (#26233)

This commit is contained in:
Connie Lei
2018-11-23 12:05:44 -05:00
committed by Aditya
parent f58043c1db
commit 92d221897c

View File

@ -10,33 +10,25 @@ Most of the time users interact through a Graphical User Interface to interact w
### Opening the Terminal and Navigating Directories ### 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 '#.' 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 To see what directory you are working in, use ```pwd``` which stands for "print working directory"
Directory is another word for folder.
```pwd``` If you want to list the directory's contents, use ```ls```
pwd stands for "Print Working Directory." Directory is another word for folder. To change directories, use ```cd <directory_path>``` which stands for change directory and replace the angle brackets with the appropriate path name.
If you are currently in `Documents` and want to move into the directory/folder `hello_world` which is inside `Documents` use `cd hello_world`
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: Here is a list of common commands:
Command | Usage Command | Usage
------------ | ------------- ------------ | -------------
pwd | Print Working Directory (Where Am I? ) `pwd` | Print Working Directory (Where Am I? )
ls | List contents of current directory `ls` | List contents of current directory
mkdir | Create a new directory `mkdir <directoryname>` | Create a new directory
touch | Create a new file `touch <filename>` | Create a new file
cp| Copy a file `cp <filetobecopied> <nameforcopiedfile>` | Copy a file
rm | Remove a file `rm <filename>` | Remove a file
rm -rf | Remove a directory `rm -rf <directoryname>` | Forcibly remove a directory
### Usage Examples ### Usage Examples