Meet the terminal in Git & Command Line
Topic 1 of 32 · 6 minFree lessonThe terminal is a window where you control the computer by typing instead of clicking. You type a command, press Enter, and the computer types its answer back. It looks plain, but it's how developers run tools like Git, which you'll meet later in this course.
Everything in this course happens in a real terminal right here on the page. You can't break your own computer with it, so feel free to experiment.
The prompt
When the terminal is ready for a command, it shows a prompt: a short line ending in $. In the examples, a line starting with $ is what you type, and the lines under it are the computer's reply.
echo is the friendliest command there is. It prints back whatever you give it:
You type echo Hello (without the $) and press Enter. The computer prints Hello, then shows the prompt again, ready for more.
Commands and arguments
The first word you type is the command. The words after it are arguments: extra details that tell the command what to work on. Spaces separate them.
Here echo is the command, and Good, morning, and Sam are its three arguments. echo prints them with a space between each.
Where am I?
The terminal is always inside one folder. Folders are also called directories. The pwd command, short for "print working directory", tells you which one you're in:
/home/learner is your home folder, where your own files live. Every terminal starts here. The slashes separate folder names, a bit like a street address that goes from the city down to the house.
Who am I?
Each person who uses a computer has an account with a short name. whoami shows yours:
Commands are often short words like this. They take a moment to learn, but they're quick to type, and you'll know the common ones by heart soon.
When a command doesn't exist
If you mistype a command, the terminal tells you it couldn't find it. Nothing breaks: read the message, fix the typo and try again.
The message starts with bash. That's the name of the program behind this terminal, called the shell. It reads what you type and runs the right command. Many Macs use a shell called zsh instead, so there the message starts with zsh and reads a little differently.
pwd works, but PWD or Pwd gives "command not found" here and on most computers. Type commands in lowercase, exactly as you see them.clear to empty the screen when it gets busy.Try it yourself
Run the code in the editor and answer 8 practice questions on meet the terminal. It's free, you only need an account.