Terminal basics
Talk to your computer with typed commands. Only five of them, and you are ready.
Learn it
The terminal is always in a folder. cd moves between folders.
The terminal (also called the command line) lets you control your computer by typing commands instead of clicking. Developers use it constantly, and you will need it to install and run things. It looks scary at first, but you only need a handful of commands.
The terminal is always "in" a folder, called the working directory. The key commands: show where you are, list what is here, change into a folder, make a new folder, and clear the screen. Folder names with spaces need quote marks around them.
Tip: press Tab to auto-complete a folder name, and the Up arrow to bring back your last command.
- Open the terminal: press the Windows key, type Terminal and press Enter. (On older Windows 10, open PowerShell instead.) You will see a line ending in
>. That is the prompt, waiting for a command. - Show where you are:
pwd
- List the files and folders here:
ls
In the old Command Prompt the command isdir. - Make a folder for all your coding projects, then move into it:
mkdir code
cd code
- Go back up one folder, then clear the screen:
cd ..
cls
- Open the terminal: press Cmd + Space, type Terminal and press Enter. You will see a line ending in
%or$. That is the prompt. - Show where you are:
pwd
- List the files and folders here:
ls
- Make a folder for all your coding projects, then move into it:
mkdir code
cd code
- Go back up one folder, then clear the screen:
cd ..
clear
- Open the terminal. On Ubuntu press Ctrl + Alt + T. On a Chromebook, first turn on Linux: Settings, then About ChromeOS (or Advanced), then Developers, then Linux development environment, then Turn on. When it finishes, open the Terminal app.
- Show where you are:
pwd
- List the files and folders here:
ls
- Make a folder for all your coding projects, then move into it:
mkdir code
cd code
- Go back up one folder, then clear the screen:
cd ..
clear
Capture the flag
+10 XPWhich command moves you into a folder? (two letters)
Create a free account to start this lab
Sign in to answer the flag question. Your progress, XP and code are saved to your account. No card needed.
Build your base camp
+20 XPUse only the terminal for this mission.
Create a free account to start this lab
Sign in to do this homework and have it checked. Your progress, XP and code are saved to your account. No card needed.