All right guys. In this module I'm going to teach you something really really cool and really useful
as well for any technology, web development or back end development. The command line is going to be your
friend.
So let us introduce you to your friend.
So at this stage you should already have the Hyper Terminal installed and working.
If you had any issues installing it be sure to check a few lessons back at the troubleshooting instructions.
It will allow you to access the Bash shell.
So what is the Bash shell?
Well to understand the Bash shell we first have to know what a shell is.
And this graphic is a good way of tackling that.
So if you think about your operating system as a pistachio nut then the kernel, so the actual pistachio,
the thing that you're going to eat. I'm really sorry about all the food analogies.
You can clearly tell I'm pretty much hungry most of the time when I’m recording these videos.
But let's get back to the topic.
So if your operating system is a pistachio, then the actual nut is the kernel.
And in computing the kernel refers to the actual program that interfaces with the hardware.
So it's the core of your operating system.
Now the shell of your pistachio or the shell in computing refers to the user interface for you as a
human to be able to interact with the kernel and in turn with the hardware of your computer.
And there's two variants to the shell.
There are graphical user interface shells.
So for example when you open up finder you're using a graphical user interface to access and find your
files.
But there's also a command line interface which is what we're going to be talking about and what we're
going to be learning about in this module.
So this is an alternative way of interfacing with the kernel.
Now it can seem intimidating at first but I want to show you that it's actually super simple.
And once you understand it you're going to see that it's actually a really really useful tool at your
disposal.
So coming back to the shell that we're going to be using which is a Bash shell. And it stands for the
Bourne Again Shell, and it's named after a Mr. Bourne, but not this Mr. Bourne but this Mr. Bourne. And I
can attest that they are equally badass. And the Bourne again Shell, or the Bash shell, is a CLI, or a command
line interpreter, for the UNIX system. And you find Unix based systems or Unix like systems all over the
place.
So for example Linux is a Unix like system and a lot of servers will run on Unix and even Mac OS 10
or the newly named Mac OS runs on a Unix like operating system.
And this is a completely different family from the Windows side of things, which uses DOS and Windows.
A lot of things that you can do with the command line can be done using the graphical user interface.
So why use the command line at all? At the end of the day, what it all boils down to is about greater
control and in your journey of becoming a better developer you will need to understand and exert more
power over your tools
that is the computer hardware.
But on a more day to day basis you will find that if you are a regular command line user, that it's actually
easier and faster to do a lot of really common things. For example, inside the terminal, if I wanted to
make a music folder then it's as simple as mkdir Music,
and now there it is.
There's my Music folder. But if I wanted to do inside Finder, for example, I first have to go to Finder,
I have to navigate to my desktop or whichever directory I want to create it inside and then I have to
maybe right click, New Folder, and then type something like Music, right?
And that takes a lot of effort.
Whereas you know say if I wanted to create Music2, make another folder, it's as simple as hitting the
up arrow and hitting 2.
So for me it's a lot about speed and a lot about control.
The other thing that you'll notice about a lot of these graphical user interfaces is they tried to hide
a lot of the
complicated stuff or the unnecessary stuff like configuration files from
the common user.
And the idea is that you know unless you know how to deal with it then you probably shouldn't be dealing
with it.
But with the command line you have full control and you have a lot of flexibility.
So for example, right now, let's just delete these two folders that I won't need. On my desktop
you can only see one folder with no files
called App Development, right?
So I’m on my desktop at the moment, inside Finder. But actually, if you use Terminal, you can actually list all
the files,
and if I just add this -a flag, you can actually see that I've also got a folder called SecretStuff,
and you create these hidden folders by simply writing mkdir .Secrets. And now if I list again
I've now got two secret folders.
And later on when we're going to teach you Git and version control, we're going to be using the command
line really heavily to show you the easiest and probably the most popular way, amongst developers at
least, of using Git and version control.
So I hope I've sold you on the virtues of the command line.
So without further ado, let's get started
learning how to use it,
what are some of the most common commands, and some tips and tricks as well.