New Student Deal only $49/month for All Access ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

Hide

Open, ls, and cd

Fundamentals ยท Lesson 4 ยท 4 minutes


We will learn to navigate through our files and folders using the power of text!

Learn these basic commands

$ open . #Mac only. 
# On Window type "start ."
$ ls # Stands for list. 
# On Windows type "dir"
$ cd Desktop 

Permission denied error? (Mac Only)

If you get a permissions error somewhere along the line, you might be able to use "sudo", which is your super user account (aka. it's like the admin of your computer that has all the privileges.) Be careful not to overuse this command. For example:

$ sudo pwd

- Now I get that this black box on your screen
is probably the scariest looking thing ever
and you're like
"I don't wanna do it, what is this thing"
Um, it may be a little intimidating
I'm gonna take you through it
and the way I like to teach is
I will type, you will copy
so follow along best you can
and step-by-step, it'll start to make sense
why we use it
because I get that at this point you may not even know why
we're using this thing
So, let's get started writing some commands
and it'll start to make sense if you just
trust me and follow along
Okay,
so the first command I am gonna teach you is this, LS here.
So type LS, that stands for list
What it's going to do is it's gonna list
all of these words
What are these words?
Well, these are different folders on your computer
Where are they?
Well, let me show you another command
So I just showed you the first one, that's LS
You may want to jot that down or
I'll put notes down below
so you can always come back to this
in the future if you get stuck, you always have this here
Another command which is important to know
is open dot
Now now now, if you're on windows, it's start dot
but, on Mac it's open dot
and if you do open dot, what it's going to do is
open up the folders on your computer
Now, it's gonna all start to come together
let me show you what I mean
So, basically, what we are doing with the terminal is
where my command prompt is,
this is the prompt, this thing blinking,
and this is where we type right?
Don't type that
but that's where you type
Um, where we are typing right now is
we are writing commands, right,
writing commands where you're basically saying
telling our computer to do things, right,
run this file, open this file, delete this file,
all the things you do on the computer yourself, right?
You come here, you make a file, you have a new file,
you delete the file, right
We can do that with text
So, that's part of the power of this
and over time, as you'll see, we can do it
a lot quicker with text and we can you do it,
you know times ten,
we can open ten folders at one time and
do some really magical things.
Alright, so back to where you and I are right now,
right now we are just opening these folders
and so everything that we do here,
in the black, in the terminal,
represents things that we are actually doing
on the computer, right?
So you can see I have this list of folders here
and we have them here
Now, on the folders here, I can go into my desktop, right,
I can click in the desktop, I can click in the documents,
I can click in the downloads, right?
And I can see what's in there
Same thing here with the commands,
let me show you another command, so
remember, LS, we'll do that again, LS,
lists everything, just like this.
Now if I want to go into another folder, I do
CD and then the name of that folder
So in this case I can into music, CD music,
and you can see it's represented here,
it's saying now we're in the music folder, right?
And now, once I'm in there, I can LS as well
and we have three folders.
We have audio, music, apps, GarageBand, iTunes
and you can see, kind of in a real life, in the folders here
we also have that
And you can continue to go in, I could say
CD GarageBand if I want
and go into that folder and again I'm here.
Pretty cool, right?
So we're just kind of moving around at this point,
we're not doing too much else, we're just moving around.
And that's what the CD, create directory, stands for.
Now if I want to go back, I do CD dot dot
and that's going to move us one back.
You can see I just moved from GarageBand back to music.
And you can do CD dot dot again,
and now you can see I'm back here, where we started.
Does that make sense?
This is gonna take some getting used to,
you're gonna have to type these a lot,
and just kind of follow along.
But, again, the notes are down below so
when you do get stuck at a later point,
you can come back to this.
So, so far all we've done is kind of open these folders
and went and gone inside of them and moved around.
Uh, trying to kind of,
the things that we do with the mouse here
we're doing with code and that's all we've done so far.