All right, let's get started with the terminal.
So in this video, we are going to learn some of the common commands you need to know as a web developer.
And to be more precise, as a back end developer, whether you are a frontend developer or back end
developer, we need to know or you need to know the command line.
But as a back end developer, you are going to spend your entire life on the terminal.
So let's get started.
Well, before we get into that, we need to know how we can open the application that we are going to
use.
Depending on your operating system, the location of your terminal differs.
So if your windows go to search and then type in terminal, if your Mac press command and space and
here we go then it's set for terminal as that and then you hit enter and my has open here for me and
this is what we call the terminal.
All right.
So let me make a little bit bigger here and increase the font a little bit or perfect.
So let me resize.
It is too big for my likeness.
Yes.
And then the height too is too tall.
Okay, perfect.
Do you remember when we covering JavaScript, you see that we're using the console in the browser to
see or debug our code.
Likewise, on the back end, we are going to use the terminal to do all our operations.
But for the terminal we can do more than using the console in the browser.
In the terminal here, the things that we can use the mouse to do that is what we are going to use it
in the terminal.
So in the terminal we are not going to use the mouse to do operations.
Let's get started with our first command and that is p, w d, which means print working directory.
So what does it mean?
Let's get back to our terminal.
On the terminal you can see that we have the first text telling us the time that we log in into the
terminal.
But what we care most is on the second line.
You can see that here.
I have the name of my computer that's a user name, and this is what we call the parent working directly.
So this one represents your explorer.
So this is the root of my files and folders.
So for this one, if I want know the folders and files inside this particular home directory here,
I can use a command list, meaning list of files and folders.
So for this one, if I hit enter, we see that I have additional folders being listed here.
Don't worry, I will show you this command very soon.
What it means for the meantime, let's explore.
Good.
It will say that inside this parent working directly, I have different folders and this and that is
the application for the downloads music public desktop library.
So if you go to the Explorer here, you see that this is what we have here.
If we see that we have applications as we see here, the first one downloads, which is this one, and
then we also have the music and that is the music folder.
Where's my music folder I think is hidden.
If we see that even on the Explorer, I cannot see the music folder, but using the terminal I can see
the music folder.
That is it.
And the public too.
You can see that here.
I cannot see it.
But when using the terminal you can see all hidden files, including pictures, postman, movies and
document.
And that is what we call the parent working directly.
So the next command is what we call m k d.
I are meaning make a new directly.
All right.
So if we want to create a new folder instead of going to your desktop like this, right click and create
new folder, we can use the command to do that and we can do that using this command called and k d
i r so check it out.
So if I want to create a folder on my desktop or wherever I want to create, let's see how we can do
it.
First of all, make sure that you are.
On the desktop.
Perfect.
So back to our terminal here.
Now, remember, inside the print working directory here we have these folders.
So I zoom in, I want to move into this folder called desktop.
How am I going to do it?
And this is a command meaning c D meaning change directory.
All right, change directory.
So here I will name my folder, which is desktop.
So let me hit enter.
Now, if we see that we have moved from the print working directory and now we are inside this folder
for desktop, so it means that I have opened my desktop.
I can achieve the same thing by using my explorer.
So if I open any folder here then I click on desktop.
So if we see that now, I am inside my desktop here.
The same thing as on our terminal, meaning we are inside our desktop.
And for this one we see that we have folders here.
So how can we see the folders on a terminal?
So any time you want to know the files and folders inside this folder, we are going to use this command
errors meaning lists of files or folders.
When I hit Enter.
Now you can see that we have the folders and files.
The first one is editing videos and web dev and portfolio demo and that's what I have it on my desktop.
You can see how we are using the terminal to move around inside our operating system.
So if we want to clear everything, you type in and hit enter.
And now I have cleared everything.
That is the clay for you.
And I have talked to you.
The WD, the McDeere and then list and then Claire.
All right, so let's continue.
The next one is, how can we create a file?
And you are going to make use of what touched.
So remember, I am on my desktop right now.
Let's stop right now.
Here, this one.
This way I am on my terminal.
This way I am.
So let's say that I want to create a file.
How can I do it?
So on my desktop I want to create a folder and call it as command.
So instead of writing this maybe right click and type in command here, I'm going to use oh, sorry,
I'm going to use the terminal to do the same thing.
So here we go.
So as I taught you make use of m k d I r and the name of the folder.
So I'll make mine as commands.
All right, our hit Enter.
And now let's see if it has been created.
So let me check.
L.
S could see that I have commands on my desktop.
So if I open my desktop here, see that I have it as that which is this one I have able to create that.
So let me open that folder.
So the next step is touch.
Let's say that I want to create a file inside that.
So let's say we are creating a HTML website.
So first I need a HTML five.
Right?
So this how we're going to do so always make sure that you are in the folder as this one by doing this
right clicking it.
And then now we are inside the folder.
So to do that, like I showed you, you make use of CD meaning change directly and then I want to change
to the folder called commands hit enter.
And now we see that I am inside the command folder which is equally as this perfect.
So let's say that I want to create a file inside that folder and we are going to use touch and the name
of the file I'm going to make it index dots HCM error when I hit enter have a look.
Now inside we have a file called index dot html.
So I think I can bring this one here.
Let me bring them here together.
Okay.
Side by side.
Yes.
I think going to be easy to navigate to see what is going on inside the terminal in the folder.
Perfect.
So again, let me delete it and then start again.
So remove that.
And now let me issue the common again.
Touch index the HTML.
I'll hit enter and there you go.
I have my index dot HTML.
That is a touch command for you.
Then you also have s.
As I told you, this wont list all files and folders in the current directory.
Meaning the current folder.
So if I want to know all the files inside this particular folder called commands or make use of ls.
And now we have one file called index dot html, which is this one.
That is it.
About the list.
So CD is used to change directory or folder.
So let's say that I want to move away from this folder.
Now I'm going to make use of c, d and then ..2. meaning go back when I hit enter.
Now I'm no more inside the command, but instead I'm inside my desktop.
So if I want to know the files inside my desktop, like I said, make use of L.
S nine.
We see that we have these files and folders on my desktop.
That is a CD for you.
The next one is our meaning.
Remove a file.
So let's say that you want to remove this particular file instead of right click in and click on delete.
We can do the same thing on the terminal, so always make sure that you are inside your working directory
or the folder.
So looking at this one, if I make use of p w d, I want to know where I am on my desktop, assuming
I'm lost.
So I'll mix of that and hit enter telling me that now I am on my desktop.
So now I think we have more text here, so let's clear the terminal.
And as that now I want to change into the command folder.
All right.
Make use of command.
So let's say that you forgot in the folder name.
So make use of L.
S.
Now you can see that this what we want to navigate in.
So I'll make this of CD and then commands and hit enter and now I'm inside my command folder.
So let's say I want to remove this particular file and I'm going to make use of r m and then the name
of the file index dot html hit enter.
Now the file has been removed from my explorer or for my folder.
That is the I m for you.
Next command is the R MDR, meaning remove and empty directory.
All right, so let's see that we have some folders which are empty.
We can remove that.
That is our MDR, right?
So let's say that this folder here or mine, Dexter, is empty, right?
Or better.
So let's create a subfolder folder inside the command.
Right, so we can make use of mkdir air.
And let's say let me call this one as I see folder nine click see that it has created the folder for
me here.
So this folder is empty, right?
So how can I remove that.
Perfect.
I'm inside my command folder, which is this.
So now I can make use of R and d, r and the name of the folder as I see hit enter.
And now the SLC folder is gone forever.
That is the error md r for you.
And then we also have our m does RF, which means remove a folder and or create contents?
Is that be careful.
This command cannot be undone.
So if you want to completely remove a folder including its contents, you you're going to use this command
r m dash rf to do that.
So let me create a folder inside the command again.
So make use of CD.
I want to go back to a previous command.
You can use the app hierarchy or down hierarchy to move up and down.
So I want to create a folder as we did before, which was the CD.
RC Now I have done that, so let's say that inside this folder let's create a file.
So let me see the into the C now I'm inside the C folder.
So inside here I want to create CSV file, make use of touch as I told you and let's see CSIS Dot.
Let me see Main.
CSIS mandates CSIS hit enter and now I have this CSIS five been here so now remember this SIRC for the
has a file so if I want to remove this folder using the armed URL, it cannot because this command is
used to remove an empty folder.
So here we go.
M r m d r and the z folder hit enter to say that no such file or directory meaning that this folder
is not empty so it cannot be found.
So if once you remove a folder where it contains, then this one shines.
I am dash RF, so check it out.
So make use of r f sorry r m dash dash f and the name of the folder which is C hit enter where a.
All right.
If we need remove simply because we are not inside the command.
Because this way.
Inside my command here.
This way I won't delete.
So part of my site.
Let's go back into this command folder and here we go.
So Sid, go back one step r m space RF and then Ursa see for the hit enter and now you see that that
folder is gone forever.
So that is it.
So these are the common commands we are going to use.
A lot.
A lot, a lot, a lot.
All right.
Now that we know the basic commands, is time to get started with no jets.