WEBVTT 0 00:00.510 --> 00:05.130 All right guys. In this module I'm going to teach you something really really cool and really useful 1 00:05.130 --> 00:11.010 as well for any technology, web development or back end development. The command line is going to be your 2 00:11.010 --> 00:11.890 friend. 3 00:11.940 --> 00:15.330 So let us introduce you to your friend. 4 00:15.330 --> 00:20.910 So at this stage you should already have the Hyper Terminal installed and working. 5 00:20.910 --> 00:27.940 If you had any issues installing it be sure to check a few lessons back at the troubleshooting instructions. 6 00:28.050 --> 00:31.560 It will allow you to access the Bash shell. 7 00:31.800 --> 00:33.150 So what is the Bash shell? 8 00:33.150 --> 00:36.960 Well to understand the Bash shell we first have to know what a shell is. 9 00:36.960 --> 00:39.920 And this graphic is a good way of tackling that. 10 00:40.290 --> 00:47.550 So if you think about your operating system as a pistachio nut then the kernel, so the actual pistachio, 11 00:47.550 --> 00:50.980 the thing that you're going to eat. I'm really sorry about all the food analogies. 12 00:51.060 --> 00:55.710 You can clearly tell I'm pretty much hungry most of the time when I’m recording these videos. 13 00:55.710 --> 00:57.240 But let's get back to the topic. 14 00:57.270 --> 01:03.820 So if your operating system is a pistachio, then the actual nut is the kernel. 15 01:03.870 --> 01:10.410 And in computing the kernel refers to the actual program that interfaces with the hardware. 16 01:10.410 --> 01:13.870 So it's the core of your operating system. 17 01:13.890 --> 01:21.630 Now the shell of your pistachio or the shell in computing refers to the user interface for you as a 18 01:21.630 --> 01:29.310 human to be able to interact with the kernel and in turn with the hardware of your computer. 19 01:29.310 --> 01:32.220 And there's two variants to the shell. 20 01:32.220 --> 01:35.240 There are graphical user interface shells. 21 01:35.340 --> 01:42.030 So for example when you open up finder you're using a graphical user interface to access and find your 22 01:42.030 --> 01:42.930 files. 23 01:43.050 --> 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 01:48.360 --> 01:50.670 going to be learning about in this module. 25 01:50.670 --> 01:55.010 So this is an alternative way of interfacing with the kernel. 26 01:55.020 --> 02:00.580 Now it can seem intimidating at first but I want to show you that it's actually super simple. 27 02:00.720 --> 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 02:05.400 --> 02:06.830 disposal. 29 02:06.870 --> 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 02:12.540 --> 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 02:20.370 --> 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 02:28.590 --> 02:37.530 line interpreter, for the UNIX system. And you find Unix based systems or Unix like systems all over the 33 02:37.530 --> 02:38.070 place. 34 02:38.070 --> 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 02:46.950 --> 02:54.220 or the newly named Mac OS runs on a Unix like operating system. 36 02:54.360 --> 03:01.680 And this is a completely different family from the Windows side of things, which uses DOS and Windows. 37 03:01.680 --> 03:06.650 A lot of things that you can do with the command line can be done using the graphical user interface. 38 03:06.750 --> 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 03:13.620 --> 03:22.020 control and in your journey of becoming a better developer you will need to understand and exert more 40 03:22.020 --> 03:24.250 power over your tools 41 03:24.270 --> 03:26.090 that is the computer hardware. 42 03:26.250 --> 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 03:32.670 --> 03:39.630 easier and faster to do a lot of really common things. For example, inside the terminal, if I wanted to 44 03:39.630 --> 03:45.140 make a music folder then it's as simple as mkdir Music, 45 03:45.270 --> 03:47.060 and now there it is. 46 03:47.070 --> 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 03:53.610 --> 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 04:00.960 --> 04:07.400 maybe right click, New Folder, and then type something like Music, right? 49 04:07.980 --> 04:09.440 And that takes a lot of effort. 50 04:09.480 --> 04:15.570 Whereas you know say if I wanted to create Music2, make another folder, it's as simple as hitting the 51 04:15.570 --> 04:17.310 up arrow and hitting 2. 52 04:17.310 --> 04:22.670 So for me it's a lot about speed and a lot about control. 53 04:22.680 --> 04:28.560 The other thing that you'll notice about a lot of these graphical user interfaces is they tried to hide 54 04:28.650 --> 04:29.940 a lot of the 55 04:30.060 --> 04:36.540 complicated stuff or the unnecessary stuff like configuration files from 56 04:36.540 --> 04:37.790 the common user. 57 04:37.890 --> 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 04:42.330 --> 04:43.050 with it. 59 04:43.380 --> 04:49.090 But with the command line you have full control and you have a lot of flexibility. 60 04:49.110 --> 04:56.070 So for example, right now, let's just delete these two folders that I won't need. On my desktop 61 04:56.070 --> 04:58.540 you can only see one folder with no files 62 04:58.540 --> 04:59.650 called App Development, right? 63 05:00.070 --> 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 05:07.030 --> 05:07.950 the files, 65 05:07.990 --> 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 05:13.840 --> 05:22.450 and you create these hidden folders by simply writing mkdir .Secrets. And now if I list again 67 05:22.510 --> 05:24.820 I've now got two secret folders. 68 05:24.820 --> 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 05:30.160 --> 05:37.930 line really heavily to show you the easiest and probably the most popular way, amongst developers at 70 05:37.930 --> 05:40.270 least, of using Git and version control. 71 05:40.750 --> 05:44.460 So I hope I've sold you on the virtues of the command line. 72 05:44.800 --> 05:47.590 So without further ado, let's get started 73 05:47.590 --> 05:49.590 learning how to use it, 74 05:49.600 --> 05:53.780 what are some of the most common commands, and some tips and tricks as well.