All right, guys. In this module, I'm going to teach you something really, really cool and really useful 1
as well, not just in iOS development, but in your future life as a developer for any other technology, 2
web development, or back end development. The command line is going to be your friend. 3
So let us introduce you to your friend. 4
So in order to use the command line on a Mac, we will be using the Terminal application. And the Terminal 5
is a way of accessing something called the Bash Shell. 6
So when you're a beginner and you're getting to grips with the command line, there's a whole load of 7
new words that you will come across. And I'm going to try and debunk some of the most common ones you'll 8
come across. 9
So what does the Bash Shell? 10
Well, to understand the Bash Shell, we first have to know what a shell is. 11
And this graphic is a good way of tackling that. 12
So if you think about your operating system as a pistachio nut, then the kernels, so the actual pistachio, 13
the thing that you're going to eat. 14
I'm really sorry about all the food analogies. 15
You can clearly tell I'm pretty much hungry most of the time when I'm recording these videos. 16
But let's get back to the topic. 17
So if your operating system macOS is a pistachio, then the actual nut is the kernel. And in computing, 18
the kernel refers to the actual program that interfaces with the hardware. 19
So it's the core of your operating system. 20
Now, the shell of your pistachio or the shell in computing refers to the user interface for you as a 21
human to be able to interact with the kernel, and in turn with the hardware of your computer. 22
And there's two variants to the shell, 23
there are graphical user interface shells. 24
So, for example, when you open up Finder, you're using a graphical user interface to access and find your 25
files. 26
But there's also a command-line interface which is what we're going to be talking about and what we're 27
going to be learning about in this module. 28
So this is an alternative way of interfacing with the kernel. 29
Now, it can seem intimidating at first. 30
Now, as a beginner, it can seem quite intimidating. But I want to show you that it's actually super simple, 31
and once you understand it, you're going to see that it's actually a really, really useful tool at your disposal. 32
So coming back to the shell that we're going to be using which is a Bash Shell and it stands for the 33
Bourne-again shell, and it's named after a Mr. Bourne, but not this Mr. Bourne, but this Mr. Bourne. And I can 34
attest that they are equally badass. And the Bourne-again shell or the Bash Shell is a CLI or a Command 35
Line Interpreter for the UNIX system. And you find UNIX-based systems or UNIX-like systems all over the 36
place. 37
So, for example, Linux is a UNIX-like system and a lot of servers will run on UNIX. and even the Mac that 38
you're using right now, 39
macOS 10 or the newly named macOS runs on a UNIX-like operating system. And this is a completely different 40
family from the Windows side of things which uses DOS and Windows. 41
So why is any of this interesting? 42
Well, once you're familiar with the Bash Shell, you're going to find the skills that you acquire to be 43
useful, not just for installing libraries on macOS, like we did in Clima, but you're going to be able 44
to use it in other projects, other cases, other operating systems as well. 45
A lot of things that you can do with the command line can be done using the graphical user interface. 46
So why use the command line at all? At the end of the day, 47
what it all boils down to is about greater control. 48
And in your journey of becoming a better developer, you will need to understand and exert more power 49
over your tools, 50
that is the computer hardware. 51
But on a more day to day basis, you will find that if you're a regular command-line user that it's actually 52
easier and faster to do a lot of really common things. For example, inside the Terminal if I wanted to 53
make a music folder, then it's as simple as mkdir Music. 54
And now there it is, 55
there's my music folder. 56
But if I want to do it inside Finder, for example, I first have to go to Finder, 57
I have to navigate to my desktop or whichever directory I want to create it inside, and then I have to maybe 58
right-click New Folder, and then type something like Music, 59
right? 60
And that takes a lot of effort, whereas, you know, say, if I wanted to create Music2, right, make another folder, 61
it's as simple as hitting the up arrow and hitting 2. 62
So for me, it's a lot about speed and a lot about control. 63
The other thing that you notice that is very prevalent with the Mac sort of environment or the Apple 64
Ethos is to try and hide a lot of the unnecessary things from the common user. 65
So that includes things like files and folders as well. 66
For example, by default, your library inside your Mac is actually hidden. 67
Now, of course, I haven't 68
been able to show students how to navigate to certain places using the graphical user interface. But by default, 69
Apple's stance is to make the user interface as simple and avoid confusion as much as possible, 70
but it's slightly paternalistic. But with the command line, you have full control and you have a lot of 71
flexibility. 72
So, for example, right now, let's just delete these two folders that I won't need. 73
On my desktop, you can only see one folder with no files, called App Development, right? 74
So I'm on my desktop at the moment inside Finder. But, actually, if you use Terminal, you can actually list 75
all the files. 76
And if I just add this dash a flag, you would actually see that 77
I've also got a folder called SecretStuff, and you can create these hidden folders by simply writing 78
mkdir., say, Secrets. 79
And now if I list again, I've now got two secret folders. And later on, what we're going to teach you 80
Git and version control. We're going to be using the command line really heavily to show you the easiest 81
and, probably, the most popular way amongst developers at least of using Git and version control. 82
So I hope I've sold you on the virtues of the command line. 83
So without further ado, let's get started learning how to use it, 84
what are some of the most common commands, and some tips and tricks as well.