We use folders to organize our files.
The folder "CS110" could be used to store files and folders for CS110.
Inside the CS110 folder you might have other folders like "Lab1" and "Project2", which contains files that are specific to just those labs and projects.
When you start the terminal, you will see a
prompt, such as the
You navigate in a terminal with commands instead of using the mouse like you would in a graphical file browser. Commands include:
cd stands for change directory.
You specify the path you want to change to, and that new path becomes the working directory.
cd command by itself will change to your home directory.
The graphical file browser (Finder, File Explorer) is working with the same files as your terminal.
mkdir to create a directory. Then look in your working directory with the graphical file browser. You will see it appear there, because you have one file system.
Every folder and file has a path that provides its unique location in your file system.
Paths that start with the root are called rooted or absolute paths.
Paths that start with the current directory are called relative paths.
If I am currently in
Documents/syllabus.pdf describes the file
I can also refer to the current directory using
So, if I am currently in
./syllabus.pdf describes the file
I can refer to the parent directory directly using
cd # goes to home directory
cd Documents # goes into Documents directory
cd cs110 # goes into cs110 directory
cd .. # goes back up to Documents directory
You can chain these together:
cd # goes to home directory, /Users/zappala
cd Documents/cs110 # goes into /Users/zappala/Documents/cs110 directory
cd ../cs260 # goes into /Users/zappala/Documents/cs260 directory
cd ../.. # goes into /Users/zappala
Press tab once to auto-complete whatever you are typing.
Sometimes, what you are typing is ambiguous (e.g. you typed
cell but there are files named
In these cases, depending on your terminal, you have some options:
A file is just a bunch of data (1's and 0's).
The file extension communicates to the OS how the data should be interpreted.
Is the data an image? .png, .gif, .jpg
Is the data a document? .docx, .pages
Is the data a PDF file? .pdf
The operating system (OS) is the software responsible for supervising all the pieces of your computer.
CPU, RAM, disk, keyboard, display, USB port, WiFi, speakers, etc.
For some of you this is Windows. For others this is Mac OS. You may have also heard of Linux—it's another operating system.
The CPU (Central Processing Unit) runs programs. Microsoft Word and Slack are examples of programs.
Since you are often running many programs at a time, and each program is composed of many tasks, the CPU is busy juggling many tasks simultaneously.
CS 224 will teach you more about how the CPU does its job of running a program.
Programs use data. For Microsoft Word, the data is a document you are editing. For Slack, it is all the messages everyone is exchanging.
All data can be represented as a sequence of 0s and 1s. We call a single 1 or 0 a bit.
We call a sequence of 8 0's and 1's a byte.
1 thousand bytes is a kilobyte. 1 million bytes is a megabyte. 1 billion bytes is a gigabyte.