A bit more about the File System
Lesson Intro
OK! So, there’s more stuff. Yep.
Now that we’ve talked about all the ‘clicky’ Graphical User Interface stuff in extreme detail, let’s explore the Command Line.
The goals
-
OH YEAH...
More about the Finder settings! Set the sidebar and some general finder preferences.
-
Zoom in and out with - basically everything
(it’s: command & – or +) Try it!
-
Understand "file paths"
How the system organizes files with paths.
-
Intro to "Terminal"
Some computers don’t have Graphical User Interfaces, so you use the command line. Serious HACKERS session.
SPACES recap

In the future, it’s likely that you will have some utility type apps or helpers that you need around. Confine them to a space and keep them available to you but out of the way. This may be things like a terminal window, an email client, or some webpage you are trying to keep open for communication.
Mission control (spaces) options

We recommend unchecking the first option and leaving the rest alone. It is confusing when the spaces automatically move based on recent use.
Tabs

There are Tabs like you may be used to in the browser, but in the finder, they seem pretty useless. What do you think? Try moving some things from one tab to another.
The file path

You can see it in many ways. At the core, it’s just some organization. There are plenty of file types and places to keep them.
Your home folder is your Username.
Macintosh Hard Drive / Users / YourUserName
This would be your Root folder.
Having a short computer name and username can make things a bit easier to read.
If you think about it, this is a lot like a set of instructions
- Go to the garage
- Look up on the top shelf
- Now, go to the box labeled “sports stuff”
- Look for the basketball
- Pick it up
Computers used to be bigger

(and way cooler looking)
The Terminal

The term “terminal” harks back to when computers were so big they’d fill up cabinets or even whole rooms. A terminal was basically a monitor (text-only) and a keyboard setup that let you operate the computer from afar through a direct, wired link. You could hook up several terminals to one computer, so multiple people could use it simultaneously.
MS DOS

Before Graphical user interfaces (even on our personal computers at home), we had things like Microsoft Disk Operating System.
This terminal is a similar experience.
(note that MS uses a back-slash \
and Mac uses a forward-slash /
)
The virtual terminal

Unlike the old physical terminals that were separate pieces of hardware for interacting with computers, the macOS Terminal is a software application that emulates a command-line interface within the operating system. This virtual terminal allows you to interact with the underlying system through a shell, just as physical terminals did with older computers, but without the need for separate hardware.
Here’s a start with how to move around the file system with the terminal (aka the command line).
Print Working Directory: pwd
Change Directory: cd
(needs a file-path too, so cd file-path-goes-here)
List Files: ls
Make Directory: mkdir
(needs a directory name, so mkdir my-directory-name
)
touch
(needs a file-name.extension): creates a file touch hello.txt
nano
(needs the file name) (details)
What else???
cd ~/
(gets you back to the root folder, but just using cd
does that too)
cd ~/a/b/c
Unix systems (like Linux and macOS) use command names that are often short to make them quick to type and easy to remember, which is a big plus for something you use a lot. ls probably comes from “list,” and it does exactly that—it lists your directory contents in a snap. Keeping command names short and mnemonic is pretty standard in Unix tool design. Naming things is hard. ls
seems weird to us. What would you have chosen?
Terminal will need permission to use your files

This is a newer security feature for Mac. Now it asks you to explicitly give each program permission to use your files. Because if they didn’t then Mark would try and look at your photos.
You might not see the window pop up or you might close it by accident. So, if your terminal isn’t able to access your files then this is why! This is a good thing to think about for any application that isn’t working.
Exercises
-
Practice navigating the file system with Terminal
The regular terminal is fine. But for some reason, we use iTerm 2. Less is more.
-
Markup a few famous websites
Find a few “famous” websites and draw some boxes on your favorite features using the screenshot software we talked about.
-
Try zooming in and out
Test it in a bunch of different applications and situations. If you have a trackpad, you can spread your fingers out across it and pinch to zoom in and out in many situations.
-
Any hidden files?
Check your “user” (home) folder for any hidden files.
Terminal commands cheetsheet
Terminal
Terminal basics
$ (this $ represents your prompt) (you do not type it)
$ pwd (print working directory to the console)
$ ls (list items in directory)
$ cd (change directory) (will go home if no path given)
$ cd a-folder-name/or-a-file-name (change to a specific folder or directory)
$ cd .. (go up one level in the directory structure)
$ cd ../directory-name (go up one level and change into another directory)
$ mkdir directory-name (create a new directory)
$ rmdir directory-name (remove an empty directory)
$ touch file-name (create a new file or update the timestamp of an existing file)
$ nano file-name (opens file in nano) (a command-line text editor)
$ rm file-name (remove a file)
$ mv old-name new-name (move or rename files or directories)
$ cat file-name (display the content of a file on the terminal)
$ echo 'text' (display a line of text/string on the terminal)
Focus on getting good with those before you try and learn any more of them.