A what is up.
Everybody this is Jason with Def soapstar calm and in this video we are going to learn how to create
folders and files in this lesson.
So let's get to it.
All right so we've already covered how to change directories.
All right.
So let's go ahead and make sure that we're at our home base here.
OK.
So I just went to the root level of my computer here.
Now what we want to do is I'm going to go ahead and change my directory to the desktop and then we're
going to go ahead and create our first folder.
So go ahead and change the directory.
We're going to put this folder on our desktop now to create a folder what we're going to do is we're
going to use a command called M-K Dern's.
So for make directory All right this is going to create folders and this is really important to know
because I use this all the time when I'm creating brand new projects or if I'm adding a folder to my
project I'll simply do this through the terminal instead of having to go into the finder find my project
right click click click some you know dropdown menu and create folders in that way.
It's a lot easier to do it like this.
And then we can go ahead and very quickly add files to this on our desktop.
We're going to create a folder make directory and we'll call this
directory bundle.
All right.
Cool.
So now if we list out the items on my desktop you can see that we have just created a folder called
directory fun and in the Finder if we go over to my desktop you'll see that we've just created the folder
right here.
Now what I'm what I'm going to do is in the Finder I want to kind of give you a visual of what's happening
here.
I'm going to double click on the folder in my finder you can see that this folder is MT-NW from our
terminal.
What we're going to do now is we're going to create some files inside of this directory.
So make sure that we change the directory into the folder we just created.
And I'm going to hit tab.
What's the directory.
How did I spell this direct or refund.
All right cool.
So now we've changed our directory in here if we list the sound just like it shows in our finder and
there is nothing here.
So to create a file we can use a command called Touch.
So simply write touch.
And then here we can create our files so say we're starting a brand new project and we need to set up
an H himself file a CSSA file maybe a javascript file so we can do that by typing in the touch command
and then typing in the file that we want to create and be sure that you had the extension of what we're
creating here so we're adding an H XML file here.
Go ahead and hit enter.
And you can see right here in the Finder that is created the h file for us.
Now check this out with this touch command.
You can actually create multiple files as well.
So let's write touch and let's say that we need a CSSA file and javascript file.
So we'll put a style CSSA in a manger.
And I'm going to go ahead and click enter and you can see that it's created both files for us.
Now let's take this up just a notch here.
Say that we need a directory to hold all of our services.
So to do that and let's use the make directory command and we're going to call this folder services.
OK.
And you can see that the folders appeared here and then we can go ahead and simply navigate into this
folder.
And let's go ahead and create we'll just call this Services dodginess.
OK.
And in the Finder I'm going to click on it here so we have a visual of what's happening.
I'm going to press enter in my terminal and it's just created the file for us.
So we have just covered how to create directories and how to create files.
And this is going to be very very important for you to know.
You're going to use this all the time especially when you're setting up brand new projects or you need
to quickly add files or directories to existing projects that you're working on.
So that is a wrap for this lesson.
Let's move on.