Skip to content

Commit

Permalink
Editorial changes to Intro to Command Line
Browse files Browse the repository at this point in the history
  • Loading branch information
MarysiaLowas committed Jul 26, 2014
1 parent a55953b commit e0bc73d
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions intro_to_command_line/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@


## Introduction
Hey girls, the following steps will show you how to use the black window. This window is also called the "command line", "cmd", "prompt" and "terminal".
Hey girls, the following steps will show you how to use the black window all hackers use. It might look a bit scary at first, but really, it is just a prompt, waiting for commands from you.

Each operating system has a set of commands for the command line.
Here is a summary of some useful commands:
The window is usually called the *command line*, but you can also hear the following names: *cmd*, *prompt*, *console* or *terminal*.

Each operating system has a slightly different set of commands for the command line. Here is a summary of some useful commands:

| Command (Windows) | Command (Mac OS / Linux) | Description | Example|
| ------------- |-----------|-------------| -----|
Expand All @@ -16,46 +17,55 @@ Here is a summary of some useful commands:
| move | mv | move file | **move c:\test\test.txt c:\windows\test.txt** |
| mkdir | mkdir | create a new folder | **mkdir testfolder** |
|del | rm | delete a folder/file | **del c:\test\test.txt**
For more about the above commands, check out the Further Information section below.
To learn more about the above commands, check out the Further Information section below.

These are just a very few of the possible black window commands.
[ss64.com](http://ss64.com) contains a complete reference of commands for all operating systems.

## Useful shortcuts

* Up arrow - rerun previous commands. You can avoid typing the same commands again by using the up arrow key to rerun recently used commands.
* **Up arrow** - rerun previous commands. You can avoid typing the same commands again by using the up arrow key to rerun recently used commands.


* Tab key - the tab key will autocomplete folder and file names. For example, typing **dir t ** + Tab will autocomplete to all directories starting with t in the current directory (such as task, test, tutorial).
* **Tab key** - the tab key will autocomplete folder and file names. For example, typing `dir t` + `Tab` will autocomplete to all directories starting with `t` in the current directory (such as task, test, tutorial).


## Further information about the commands above

* The **exit** commmand - this will cause the window to close; it makes sense, right? No need to explain too much ...
* **exit** - it closes the black window; it makes sense, right? No need to explain too much...


* **cd** - it allows you to change your current directory. To use it type `cd [directoryname]` and press enter.

**For example:** let's say you are in a directory called `c:\test` with three sub-directories: `documents`, `photos`, and `music`.

c
└───test
documents
photos
music

* The **cd** command - this command allows you to change your current directory. To use the cd command you type cd directoryname and press enter.
For example if you are in a directory called c:\test, and there were three directories in that the test directory called A, B, and C, you could just type **cd A** and press enter. You would then be in the c:\test\A.
To go to the `documents` directory, simply type `cd documents` and press enter. You are now in `c:\test\A`. To move back to the `c:\test` directory, type `cd ..`.


* The **cd ..** command - this will take you to the next folder up.
* **dir** (Windows) / **ls** (others) - it lists files and directories located in your current directory. If you type `dir \test` or `ls test`, you will see the content of the `c:\test` directory.
Note that for many commands you can use the `*` symbol which stands for *all* or *wildcard*. With this in mind, try typing `dir *.txt` for Windows or `ls *.txt` for other OS. It will list only files that end with `.txt`.


* The **dir** (Windows) and **ls** (others) command - this will list the files and directories contained in your current directory. If I typed **dir \test** or **ls test** I would see the contents of the c:\test directory.
Also note for many commands you can use the \* symbol which stands for wildcard. With this in mind, typing **dir *.txt** on WIN or **ls *.txt** on other OS will only list those files that end with .txt.
* **copy** (Windows) / **cp** (others) - it allows you to copy files from one location to another. To use this command, type `copy [sourcefile] [targetfile]`.

**For example**: if you have the file `c:\test\test.txt` and you would like to copy it to `c:\windows\test.txt`, type:

* The **copy** (Windows) or **cp** (others) command - this allows you to copy files from one location to another. To use this command you would type **copy *sourcefile targetfile***. For example if you have the file c:\test\test.txt and would like to copy it to c:\windows\test.txt you would type
**copy c:\test\test.txt c:\windows\test.txt** and press enter.
copy c:\test\test.txt c:\windows\test.txt


* The **move** (Windows) or **mv** (others) command - this allows you to move files from one location to another. The syntax you use is the same as for the **copy** command.
* **move** (Windows) / **mv** (others) - it allows you to move files from one location to another. The syntax you use is the same as for the `copy` command.


* The **mkdir** command - this allows you to create a new directory. For example **mkdir temp** creates a new folder called temp in the current directory.
* **mkdir** - it allows you to create a new directory. For example, `mkdir temp` creates a new folder called `temp` in the current directory.


* The **del** (Windows) or **rm** command (others) - this allows you to delete the specified file. For example, **del test.txt** deletes the test.txt file from the current directory.
* **del** (Windows) / **rm** (others) - it allows you to delete the specified file. For example, `del test.txt` deletes the `test.txt` file from the current directory.



Expand Down

0 comments on commit e0bc73d

Please sign in to comment.