Course Overview + The Shell
MIT 6.NULL The Missing Semester of Your CS Education, lecture 1, explained in plain English
Want this lecture to stick? In LessonBound you get checked practice questions for every part, can ask about anything you don't get, and can listen with your screen off. Free, no ads.
Learn this lecture freeWatch or read the original lecture: MIT OpenCourseWare.
Part 1
This part introduces the shell, a text-based way to give your computer commands, and shows the basic moves for running programs and finding your way around files.
Key ideas
- The shell is a text interface for giving your computer commands. It can do things that buttons and voice controls cannot, because you type exactly what you want.
- You type a command at the prompt, starting with a program name. Words after it are arguments, which the program receives as extra input.
- When you type a program name, the shell searches the folders listed in $PATH to find that program.
- A path is a list of folders. An absolute path starts from the root, while a relative path starts from where you are now. The commands pwd and cd show and change your location.
- The ls command lists what is in a folder. Flags, which start with a dash, change how a command behaves, and the -l flag shows details such as permissions.
Words to know
- shell
- A program that reads the commands you type and runs them, so you can control the computer with text.
- terminal
- The window where you type into the shell. It is the place where the text prompt appears.
- argument
- Extra information you give a program after its name, such as the word hello in echo hello.
- relative path
- A location written from where you are right now, not from the very top of the file system. It does not start with a slash.
Example
Think of the shell like a librarian who only responds to written requests. When you ask for a book by name, she checks each shelf on her list in order until she finds it, which is how $PATH works. Your arguments are the extra details you add to the request, such as which edition you want.
3 checked practice questions for this part are in the app.
Part 2
This part explains how file permissions work, how the shell can send program input and output to files or to other programs, and how the root user and sudo control powerful access.
Key ideas
- Permissions control what each user can do. To enter a directory you need the execute (x) permission on it and on its parents, and to list its contents you need the read (r) permission.
- Every program has an input stream and an output stream. By default both are your terminal, but redirection lets you point them at a file instead.
- The pipe operator | connects programs so that the output of one becomes the input of the next.
- The root user can do almost anything on the system. You should not normally log in as root, so you use sudo to run a single command with root power.
- Even with sudo, writing to a file in /sys failed with Permission denied. The lesson calls this an important thing to know about the shell, and it does not fully explain why in this part.
Words to know
- stream
- A flow of data going into or out of a program, like a stream of text going in from the keyboard or out to the screen.
- redirection
- Changing where a program gets its input or sends its output, such as sending the output into a file instead of the screen.
- pipe
- A way to join two programs so the first one's output is passed directly to the second one as its input.
- sudo
- A command that lets you run one other command with root (super user) power, without logging in as root.
Example
Think of a pipe like a factory assembly line. One worker finishes a part and passes it straight to the next worker, who does the next step. Each worker only needs to handle what arrives from the one before, just as each program in a pipe only reads what the previous program output.
3 checked practice questions for this part are in the app.
Lecture 2: Shell Tools and Scripting →
Notes written by AI (Claude) from the lecture's official transcript, so check anything important against the lecture. MIT CSAIL · CC BY-NC-SA 4.0 · not affiliated with or endorsed by MIT. These notes are shared under the same license.
LessonBound · Free lecture notes · Privacy · Terms · New York