Skip to lesson

What is the terminal?

I'm on:

Showing steps for Windows. They are marked “On Windows” below.

A terminal is a window where you give your computer commands by typing instead of clicking. You type one line, press Enter, and the computer answers in text.

Why developers use the terminal

The terminal, also called the command line, is a window where you type commands as text and the computer answers in text. There are no buttons: one typed line does one job.

Your IDE's Run button hides a secret: it types commands such as javac and java for you. Git, which comes later in this section, is used mostly by typing. Servers, the computers that run apps like UPI all day, have no screen at all, so developers work on them through a terminal.

Commands are also exact. You can repeat a command, keep it in your notes and send it to a friend, which is much easier than "click File, then Settings, then…".

Open the terminal

A shell is the program inside the terminal that reads each command you type, runs it and shows the result. Windows uses a shell called PowerShell; macOS uses a shell called zsh.

This course uses one shell on each computer, and shows the commands and output for the computer you pick at the top of this page.

On Windows

On Windows you use Windows PowerShell. It comes with Windows, so there is nothing to install.

  1. Press the Windows key and type powershell.
  2. Click Windows PowerShell. A dark blue window opens with a line like PS C:\Users\Priya>.
  3. Right-click its icon in the taskbar → Pin to taskbar, so it is always one click away.
Windows also has an older shell, Command Prompt (cmd), where some commands differ. Stay in PowerShell for this module. In the Git Basics module you install Git, which brings Git Bash, and Git work moves there.

Your first command

A command is one line you type for the shell: the name of a program, often followed by extra words called arguments that tell the program what to do or what to work on.

Start with two safe commands. echo prints back the words you give it, and javac -version asks the Java compiler which version it is. Type each line and press Enter.

Example 1 · Your first two commands

Windows PowerShell
PS C:\Users\Priya> echo "Hello, Priya"PS C:\Users\Priya> javac -versionOutputHello, Priya
javac 19.0.2

What this code does

  • echo printed the words inside the quotes. Then the prompt came back, ready for the next line.
  • In javac -version, javac is the program and -version is an option: an argument that starts with - and changes what the program does.
  • Your version number may differ, for example javac 25.0.1. Any number means the JDK works.

Read the prompt

The prompt is the text the shell prints when it is ready for your next command. It shows which folder you are in. You type after the prompt; you never type the prompt itself.

Guides often show a command with a prompt in front of it, like $ java -version or PS> java -version. Type only the part after the prompt: java -version.

On Windows

In PowerShell the prompt starts with PS, then the folder you are in, then >. PS C:\Users\Priya> means you are in Priya's home folder, C:\Users\Priya.

A PowerShell window. PS C:\Users\Priya> is the prompt; echo "Hello, Priya" after it is the command you type. The next line, Hello, Priya, is the output. Then the prompt appears again, ready for the next command.

When a command is not found

A small typo is the most common mistake. The shell then looks for a program with the wrong name, finds none, and says so.

Example 2 · A typo: not recognized

Windows PowerShell
PS C:\Users\Priya> jav -versionjav : The term 'jav' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.

What this code does

  • PowerShell found no program named jav, so it quotes that name back to you. The fix is to type java.
  • PowerShell prints a few more lines under this (they start with At line:1 and +). The first line is the one that matters.

Press Up arrow to bring back the last command, fix the spelling and press Enter again. Two more keys help every day: Ctrl+C (Control+C on a Mac) stops a command that keeps running, and clear wipes the screen.

Installed a new tool and it is still not found? Close the terminal and open a new one: a window learns about new tools only when it opens. Environment variables, PATH and redirection (opens in a new tab) explains why.

Next step

Check your understanding

8 quick questions