0
1
00:00:00,510 --> 00:00:05,130
All right guys. In this module I'm going to teach you something really really cool and really useful
1

2
00:00:05,130 --> 00:00:11,010
as well for any technology, web development or back end development. The command line is going to be your
2

3
00:00:11,010 --> 00:00:11,890
friend.
3

4
00:00:11,940 --> 00:00:15,330
So let us introduce you to your friend.
4

5
00:00:15,330 --> 00:00:20,910
So at this stage you should already have the Hyper Terminal installed and working.
5

6
00:00:20,910 --> 00:00:27,940
If you had any issues installing it be sure to check a few lessons back at the troubleshooting instructions.
6

7
00:00:28,050 --> 00:00:31,560
It will allow you to access the Bash shell.
7

8
00:00:31,800 --> 00:00:33,150
So what is the Bash shell?
8

9
00:00:33,150 --> 00:00:36,960
Well to understand the Bash shell we first have to know what a shell is.
9

10
00:00:36,960 --> 00:00:39,920
And this graphic is a good way of tackling that.
10

11
00:00:40,290 --> 00:00:47,550
So if you think about your operating system as a pistachio nut then the kernel, so the actual pistachio,
11

12
00:00:47,550 --> 00:00:50,980
the thing that you're going to eat. I'm really sorry about all the food analogies.
12

13
00:00:51,060 --> 00:00:55,710
You can clearly tell I'm pretty much hungry most of the time when I’m recording these videos.
13

14
00:00:55,710 --> 00:00:57,240
But let's get back to the topic.
14

15
00:00:57,270 --> 00:01:03,820
So if your operating system is a pistachio, then the actual nut is the kernel.
15

16
00:01:03,870 --> 00:01:10,410
And in computing the kernel refers to the actual program that interfaces with the hardware.
16

17
00:01:10,410 --> 00:01:13,870
So it's the core of your operating system.
17

18
00:01:13,890 --> 00:01:21,630
Now the shell of your pistachio or the shell in computing refers to the user interface for you as a
18

19
00:01:21,630 --> 00:01:29,310
human to be able to interact with the kernel and in turn with the hardware of your computer.
19

20
00:01:29,310 --> 00:01:32,220
And there's two variants to the shell.
20

21
00:01:32,220 --> 00:01:35,240
There are graphical user interface shells.
21

22
00:01:35,340 --> 00:01:42,030
So for example when you open up finder you're using a graphical user interface to access and find your
22

23
00:01:42,030 --> 00:01:42,930
files.
23

24
00:01:43,050 --> 00:01:48,360
But there's also a command line interface which is what we're going to be talking about and what we're
24

25
00:01:48,360 --> 00:01:50,670
going to be learning about in this module.
25

26
00:01:50,670 --> 00:01:55,010
So this is an alternative way of interfacing with the kernel.
26

27
00:01:55,020 --> 00:02:00,580
Now it can seem intimidating at first but I want to show you that it's actually super simple.
27

28
00:02:00,720 --> 00:02:05,400
And once you understand it you're going to see that it's actually a really really useful tool at your
28

29
00:02:05,400 --> 00:02:06,830
disposal.
29

30
00:02:06,870 --> 00:02:12,540
So coming back to the shell that we're going to be using which is a Bash shell. And it stands for the
30

31
00:02:12,540 --> 00:02:20,370
Bourne Again Shell, and it's named after a Mr. Bourne, but not this Mr. Bourne but this Mr. Bourne. And I
31

32
00:02:20,370 --> 00:02:28,590
can attest that they are equally badass. And the Bourne again Shell, or the Bash shell, is a CLI, or a command
32

33
00:02:28,590 --> 00:02:37,530
line interpreter, for the UNIX system. And you find Unix based systems or Unix like systems all over the
33

34
00:02:37,530 --> 00:02:38,070
place.
34

35
00:02:38,070 --> 00:02:46,950
So for example Linux is a Unix like system and a lot of servers will run on Unix and even Mac OS 10
35

36
00:02:46,950 --> 00:02:54,220
or the newly named Mac OS runs on a Unix like operating system.
36

37
00:02:54,360 --> 00:03:01,680
And this is a completely different family from the Windows side of things, which uses DOS and Windows.
37

38
00:03:01,680 --> 00:03:06,650
A lot of things that you can do with the command line can be done using the graphical user interface.
38

39
00:03:06,750 --> 00:03:13,620
So why use the command line at all? At the end of the day, what it all boils down to is about greater
39

40
00:03:13,620 --> 00:03:22,020
control and in your journey of becoming a better developer you will need to understand and exert more
40

41
00:03:22,020 --> 00:03:24,250
power over your tools
41

42
00:03:24,270 --> 00:03:26,090
that is the computer hardware.
42

43
00:03:26,250 --> 00:03:32,490
But on a more day to day basis you will find that if you are a regular command line user, that it's actually
43

44
00:03:32,670 --> 00:03:39,630
easier and faster to do a lot of really common things. For example, inside the terminal, if I wanted to
44

45
00:03:39,630 --> 00:03:45,140
make a music folder then it's as simple as mkdir Music,
45

46
00:03:45,270 --> 00:03:47,060
and now there it is.
46

47
00:03:47,070 --> 00:03:53,560
There's my Music folder. But if I wanted to do inside Finder, for example, I first have to go to Finder,
47

48
00:03:53,610 --> 00:04:00,600
I have to navigate to my desktop or whichever directory I want to create it inside and then I have to
48

49
00:04:00,960 --> 00:04:07,400
maybe right click, New Folder, and then type something like Music, right?
49

50
00:04:07,980 --> 00:04:09,440
And that takes a lot of effort.
50

51
00:04:09,480 --> 00:04:15,570
Whereas you know say if I wanted to create Music2, make another folder, it's as simple as hitting the
51

52
00:04:15,570 --> 00:04:17,310
up arrow and hitting 2.
52

53
00:04:17,310 --> 00:04:22,670
So for me it's a lot about speed and a lot about control.
53

54
00:04:22,680 --> 00:04:28,560
The other thing that you'll notice about a lot of these graphical user interfaces is they tried to hide
54

55
00:04:28,650 --> 00:04:29,940
a lot of the
55

56
00:04:30,060 --> 00:04:36,540
complicated stuff or the unnecessary stuff like configuration files from
56

57
00:04:36,540 --> 00:04:37,790
the common user.
57

58
00:04:37,890 --> 00:04:42,330
And the idea is that you know unless you know how to deal with it then you probably shouldn't be dealing
58

59
00:04:42,330 --> 00:04:43,050
with it.
59

60
00:04:43,380 --> 00:04:49,090
But with the command line you have full control and you have a lot of flexibility.
60

61
00:04:49,110 --> 00:04:56,070
So for example, right now, let's just delete these two folders that I won't need. On my desktop
61

62
00:04:56,070 --> 00:04:58,540
you can only see one folder with no files
62

63
00:04:58,540 --> 00:04:59,650
called App Development, right?
63

64
00:05:00,070 --> 00:05:07,030
So I’m on my desktop at the moment, inside Finder. But actually, if you use Terminal, you can actually list all
64

65
00:05:07,030 --> 00:05:07,950
the files,
65

66
00:05:07,990 --> 00:05:13,540
and if I just add this -a flag, you can actually see that I've also got a folder called SecretStuff,
66

67
00:05:13,840 --> 00:05:22,450
and you create these hidden folders by simply writing mkdir .Secrets. And now if I list again
67

68
00:05:22,510 --> 00:05:24,820
I've now got two secret folders.
68

69
00:05:24,820 --> 00:05:30,160
And later on when we're going to teach you Git and version control, we're going to be using the command
69

70
00:05:30,160 --> 00:05:37,930
line really heavily to show you the easiest and probably the most popular way, amongst developers at
70

71
00:05:37,930 --> 00:05:40,270
least, of using Git and version control.
71

72
00:05:40,750 --> 00:05:44,460
So I hope I've sold you on the virtues of the command line.
72

73
00:05:44,800 --> 00:05:47,590
So without further ado, let's get started
73

74
00:05:47,590 --> 00:05:49,590
learning how to use it,
74

75
00:05:49,600 --> 00:05:53,780
what are some of the most common commands, and some tips and tricks as well.
