You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: command-line/introduction/tutorial.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ To access the command line, we use a terminal emulator, usually called a termina
13
13
14
14
## Example 1: navigating around in the terminal
15
15
16
-
Once you opened up your terminal, type in the following after the $ or > sign and hit enter: ($ or > is the prompt, you don't have to retype that in the terminal, only the characters that come after them):
16
+
Once you opened up your terminal, type in the following after the `$` or `>` sign and hit enter: (`$` or `>` is the prompt, you don't have to retype that in the terminal, only the characters that come after them):
17
17
18
18
```bash
19
19
$ pwd
@@ -23,7 +23,7 @@ $ pwd
23
23
24
24
### `pwd` or print working directory
25
25
26
-
The `pwd` command prints out the current directory you are in. What are directories? Directories are folders, these terms are used interchangeably. If you just opened up your terminal, you are probably in the root directory of your computer, and should get an output similar to this:
26
+
The `pwd` command prints out the current directory you are in. What are directories? Directories are folders, these terms are used interchangeably. If you just opened up your terminal, you are probably in the home directory of your computer, and should get an output similar to this:
27
27
28
28
```bash
29
29
/Users/your-username
@@ -39,7 +39,7 @@ In your terminal type:
39
39
$ ls
40
40
```
41
41
42
-
and hit enter. Most likely this command returned you a bunch of files and directories (folders). The `ls` command prints out the contents of a directory. If you are in the root directory of your computer you should see directories printed out such as Documents, Applications, etc. Now the question is, how do I move between directories?
42
+
and hit enter. Most likely this command returned you a bunch of files and directories (folders). The `ls` command prints out the contents of a directory. If you are in the home directory of your computer you should see directories printed out such as Documents, Applications, etc. Now the question is, how do I move between directories?
43
43
44
44
### `cd` or change directory
45
45
@@ -63,7 +63,7 @@ Now type:
63
63
$ pwd
64
64
```
65
65
66
-
This should return you name of the directory you just `cd` into.
66
+
This should return you the name of the directory you just `cd` into.
67
67
68
68
Type `ls` into the terminal, choose another directory and `cd` into it. We have just changed into a new directory. You can use these two commands to navigate around the directory structure of your computer. This is all good so far but sometimes you might want to go deeper than one level in one command. `cd` allows you to do this by chaining the directories with a `/`, so `cd your-directory` becomes `cd your-directory/directory-inside-your-directory`.
69
69
@@ -73,25 +73,25 @@ We now know how to move forward but how to go back up the directory tree? In you
73
73
$ cd ..
74
74
```
75
75
76
-
Now do a `pwd`. You just went back one directory! Chaining works backward too, so if you type `cd ../..` you should be taken back two directories.
76
+
Now do a `pwd`. You just went back one directory! Chaining works backwards too, so if you type `cd ../..` you should be taken back two directories.
77
77
78
-
> If you want to go back to the root directory of your computer, simply type `cd` into the terminal. `cd` without an argument takes you back to the root directory regardless of where you are currently in the directory structure
78
+
> If you want to go back to the home directory of your computer, simply type `cd` into the terminal. `cd` without an argument takes you back to the home directory regardless of where you are currently in the directory structure
79
79
80
-
### Exercise 1: use `ls` and `cd` to move in and out of a few directories on your machine
80
+
### Exercise 1: use `ls` and `cd` to move in and out of a few directories on your computer
81
81
82
-
Those are the basics of navigating around in the terminal. What else would we want to do in there? How about creating directories and files?
82
+
These are the basics of navigating around in the terminal. What else would we want to do in there? How about creating directories and files?
83
83
84
84
## Example 2: creating directories and files
85
85
86
86
### `mkdir` or make directory
87
87
88
-
Go back to the root directory of your computer, and type:
88
+
Go back to the home directory of your computer, and type:
89
89
90
90
```bash
91
91
$ mkdir temp
92
92
```
93
93
94
-
into the terminal. Now use `ls` to see the contents of the root directory. You should see a new folder, temp there. You just created a new folder! As it's name suggests, mkdir creates directories. What if we wanted to create a directory inside a directory? `cd` into temp and type:
94
+
into the terminal. Now use `ls` to see the contents of the home directory. You should see a new folder, temp there. You just created a new folder! As it's name suggests, mkdir creates directories. What if we wanted to create a directory inside a directory? `cd` into temp and type:
95
95
96
96
```bash
97
97
$ mkdir stuff/bits
@@ -111,7 +111,7 @@ Do an `ls` to check whether the file has been created. Inside bits, there should
111
111
112
112
### Exercise 2: `cd` back into temp and create a couple of new folders with files in them
113
113
114
-
### Bonus: type this into your terminal:
114
+
### Bonus: if you are on a Mac, type this into your terminal:
0 commit comments