Learn Mac Terminal Basics

MacOS Tips
1 follower
May 5, 2026
Hi, this is Gary with MacMost.com.
Here are the basics for using Terminal on your Mac.
So when you normally use your Mac, you're using what's called a graphical user interface
to interact with your files.
For instance, you've got here a window, you use a pointer with a mouse or trackpad,
you can click things, drag things.
That's all part of a graphical user interface.
But you could also use a command line interface,
which doesn't require a mouse or trackpad at all.
Just you typing and reading plain text.
To do that, you use an app called Terminal.
You can launch it the way you launch any app that comes on your Mac.
So I'm going to use Launchpad here to launch Terminal.
And here I am in the Terminal window.
And it's just text here.
And I just type something and press return and see the results.
So when you're using a graphical user interface like this Finder window,
there's a location that you're at.
You're here in the Documents folder.
And the same is true when you're working in Terminal.
Now there's a location here as well.
And actually, you can see it.
But to have it spelled out for us, we'll use our first command,
which is pwd, present working directory.
When I type those three letters and then press return, I get some output.
The output here is users slash MacMost.
In other words, my MacMost folder in the users folder.
My home directory, in other words.
And actually, we knew that already because it showed us that in the line,
this tilde character is actually an abbreviation for your home folder.
Now we don't see a list of files and folders here, but we can ask for it.
ls is a command that will list the files.
If I press return, I can see a list of everything here.
If I were to use the Finder and look in my home directory,
I would see those folders there, the same ones listed here in Terminal.
Now, if I want to navigate down into one of those folders,
I would use another command, cd, for change directory.
And I would type the directory name, document, and then return.
Now notice that the prompt here, in addition to having my account username,
has documents here.
It did it before.
It gave me a tilde, and a tilde character is an abbreviation for your home folder.
So the information was there if we knew what to look for.
Now, if I were to list the files and folders here,
I would get a bigger list that includes a bunch of folders and even a file here.
If you find these videos valuable,
consider joining the more than 2,000 others that support MacMost at Patreon.
You get exclusive content, course discounts, and more.
You can read about it at macmost.com slash Patreon.
With any command like ls, you can modify it using a dash and then usually letters.
So ls by itself gives us the simple list.
But if we do dash l, we get a list that looks like this.
You could see each file and folder is on a separate line
and includes lots of information, like a date, for instance, and a file size.
We could have also done ls dash a for all files, including invisible ones.
And I do that, you could see some invisible files that are here,
ones you normally wouldn't see in the Finder.
You can combine different modifiers like l and also a like that.
And now I'll get a list in long form that also includes the invisible files.
Now, we can use cd to go down into a folder.
So, for instance, if I wanted to go down into the temp folder here,
I could do it like this.
And now I can list the files in the temp folder.
If I wanted to go back up, I can do cd and then dot dot.
Two dots represents going up one level.
So I do that.
And now if I look at present working directory,
I can see I'm back up at the documents folder level.
I could also just type a full path.
So I can do cd and then slash and then users and then slash and MacMost
and then slash and documents like that to get to my documents folder.
But remember, tilde can be used as a substitute for users slash
and your home folder.
So I can do tilde slash documents and end up in the same place.
So that's great for just looking at your files and folders.
But how do you actually do things?
Well, you use other commands.
For instance, mkdir is make directory.
So I can make a new directory.
I'll call this temp two like that.
And now when I list the files, I see there is a temp two directory that I created.
And I could dive down into that temp two folder with cd.
Then let's go back up a level with the two dots after cd like that.
And we've got this one file here, testing dot txt.
We can move it or rename it using the mv command, which stands for move.
Moving and renaming is essentially the same thing.
You're moving the file to a new location.
Now, I could simply say I want to move testing dot txt to a file named something else dot
txt like that.
And then when I list the files, you could see that that file now is a new name.
But I could also move it at the same time.
So mv something else dot txt, I can move, say, into that temp two folder and call it,
say, x dot txt.
And now you could see it's gone here from this level.
And if I go down into temp two and list the files there, you could see that file has been
moved and renamed at the same time.
You could also copy a file with cp so I can copy x dot txt to y dot txt like that.
And now I've duplicated the file, so I have two of them.
And if I wanted to delete one of them, I could use rm for remove.
So y dot txt will remove that file.
You could see there's no safety net here, which is one of the reasons sometimes people
are a little afraid to use terminal.
It doesn't give you a warning, doesn't go into the trash.
It just obeys your command and removes that file.
So always exercise a little extra caution when using rm.
And you could also open a file in a regular app, a graphical user interface app with open.
This is just like double clicking it in the finder.
So if I did that with x dot txt, it would open that up here in the default app, which
in this case is text edit.
Now, when you can use open to open a file in any app on your Mac, there are also times
when you want to actually use that file in terminal.
And there are apps that work inside of terminal instead of in separate windows.
For instance, the app Pico is a text editor.
If I just type Pico and return, I'm in this whole new interface here and I could type
something and use the commands below to save it.
So for instance, if I do control x to exit here, it will ask if I want to save.
Yes or no.
If I type yes, it'll ask for the name.
So I'll type something dot txt return.
And now if I look where I'm at here, I see there is a file called something dot txt.
There are lots of other apps like that that work in terminal.
If you really want to impress somebody, just type the simple command top and it runs an
app called top that shows you all of your Mac's running processes.
It kind of looks like activity monitor, but it's here inside of terminal.
To exit an app like this, you can usually press Q or you can use control C to terminate
an app.
But one of the main reasons people use terminal is not for any of the things I just showed
you, but to instead use a command called defaults.
What defaults does is it allows you to set a system setting.
You see, there are more system settings that are shown in the system settings app and you
can get to some of those hidden ones using the defaults command.
So often you'll see a post somewhere that says in order to make your Mac behave like
this, type this into terminal and that command starts with the word defaults.
So for instance, I'll take defaults and then give it a command right to write a new property
and then do calm dot apple dot screen capture.
So that's a set of settings.
I'm going to change the screen capture settings.
The actual setting is the type setting, what type of file to save screen captures as, and
I'm going to type JPG.
So it will now save screen captures.
It's JPEGs instead of PNGs.
When I press return now, I've changed that setting to remove that I could use the same
command, but PNG instead or defaults and then delete to delete the setting.
In other words, go back to whatever the apps default is and then screen capture and then
type.
I don't have to include anything at the end because the idea is delete the setting where
it specifies JPEG and go back to the default setting for that.
So now it will save as PNGs again.
A few last tips.
You may notice that sometimes I start with a fresh screen there.
You could do that at any time with command and K.
Also, you don't have to type out everything because there's autocomplete.
If I do, I'll ask to see what's here and let's say I want to go down into the developer folder.
I could type CD and start typing developer like that, but I don't have to complete the
entire word.
I can just press tab and it will complete it for me.
So you can very quickly get down into folders.
Also notice that if there's a space in a name, then things don't always work.
If I do CD and I want to go down into some files, you could see it doesn't work.
It's looking for some and it considers files to be something separate.
Since there's a space, an easy way to specify exactly what you want is put quotes around
anything with a space.
So this will work.
And also, if you need to type similar commands over and over, you don't have to start from
scratch.
Use the up arrow to go and see your previous commands and you can continue to go up through
everything and see exactly what you've typed in the past.
And then when you get to a command you want, you can just backspace over it and type something
else and return.
You can also use the left arrow to go through the line and hold the option key down to jump
by word.
Also note, you don't have to stay in one terminal window.
You can go and create a new window like that and have multiple terminal windows open so
you could be working in one folder in one window and another folder in another window
or have Pico editing a file in one window while you're going down and moving files around
in another.
And finally, if you want to know more about a command like all the different modifiers
you can use, use MAM for manual and then type the command.
So for instance, for LS here, it will bring this up.
You can use spacebar to go by page or the arrow keys to go up and down and you can see
all the different modifiers and further explanation of how the command works and how to use it.
And then just Q to quit out of the manual app.
So if you want to learn more about using terminal, I suggest creating a demo folder, say in your
documents folder, use terminal to go into that, create some files, move some files around,
just stick in that folder while testing things out and figuring out how things work.
Hope you find this useful.
Thanks for watching.
