Opening the command line on your computer
The command line is a text-based program already built into your computer — you do not need to read or install anything. On Windows, it is called Command Prompt or PowerShell. On Mac, it is called Terminal. On Linux, it is usually called Terminal or Konsole, depending on which version you have. The steps below show you how to find and open whichever one your computer has.
Once you open it, you will see a blank window with a blinking cursor and a line of text that tells you where you are in your computer's file system. That text is called the prompt, and it is where you type commands. The command line itself does not do anything until you type a command and press Enter.
Key Takeaways
- Windows computers have Command Prompt built in; you can find it by typing "cmd" into the search box on your taskbar.
- Mac computers have Terminal in the Applications folder under Utilities; you can also open it by pressing Command+Space and typing "terminal".
- Linux computers usually have Terminal or Konsole in the applications menu, or you can right-click on the desktop and select "Open Terminal Here".
- Once open, the command line shows a prompt — a line of text where you type commands — and does nothing until you press Enter after typing.
- You can close the command line window at any time by typing "exit" and pressing Enter, or by clicking the X button.
Opening Command Prompt or PowerShell on Windows
The easiest way to open the command line on Windows is to use the search box. Click the search icon on your taskbar at the bottom left of your screen, or press the Windows key and start typing. Type "cmd" and you will see Command Prompt appear in the search results. Click on it to open it.
If you want to use PowerShell instead — a newer version of the command line with more features — search for "powershell" the same way. Both do the same basic job; PowerShell is straightforward newer and more powerful. For most tasks, Command Prompt works fine.
You can also right-click on your desktop or inside a folder and look for an option that says "Open Command Prompt Here" or "Open PowerShell Window Here". This opens the command line already pointing at that folder, which saves you a step if you know which folder you want to work in.
Opening Terminal on Mac
On a Mac, the command line is called Terminal. The fastest way to open it is to press Command+Space to open Spotlight search, then type "terminal" and press Enter. Terminal will open when ready.
If you prefer to find it manually, open Finder, click Applications in the sidebar, then double-click the Utilities folder. You will see Terminal in that folder. Double-click it to open it.
You can also right-click on a folder in Finder and look for an option that says "New Terminal at Folder" or "Open Terminal Here", depending on your Mac's version. This opens Terminal already pointing at that folder.
Opening Terminal or Konsole on Linux
Most Linux computers have a Terminal process in the applications menu. Click the applications menu (the exact location depends on which version of Linux you have — it might be in the top left, bottom left, or top right), then search for "Terminal" or "Konsole" and click it.
On many Linux desktops, you can also right-click on the desktop itself and select "Open Terminal Here" from the menu that appears. This is often the fastest way.
Some Linux computers also let you press Ctrl+Alt+T to open Terminal directly, though this does not work on all versions. If that does not work, use the applications menu instead.
What you will see when the command line opens
When you open the command line, you will see a window with a dark background (usually black or dark blue) and a line of text at the bottom. That line is the prompt. On Windows, it usually looks like "C:\Users\YourName>" or "PS C:\Users\YourName>". On Mac and Linux, it usually looks like "YourName@ComputerName ~ %".
The prompt tells you two things: where you are in your computer's file system, and that the command line is ready for you to type. The blinking cursor sits right after the prompt, waiting for input. You type your command there, then press Enter to run it.
If nothing happens after you open the window, or if you see an error message, your computer may not have the command line installed — though this is rare. On Windows, Command Prompt comes with every version. On Mac and Linux, Terminal comes built in. If you cannot find it, restart your computer and try again.
Running your first command
Once the command line is open, you can type a straightforward command to make sure it is working. On any system, type "echo hello" and press Enter. The command line will print the word "hello" on the next line, then show you a new prompt. This confirms that the command line is working and listening to your input.
Do not worry about what "echo" means or why it works — the point is just to see that typing a command and pressing Enter produces a result. From here, you can type any command you need to run. If you make a mistake, you can press the up arrow key to bring back the last command you typed, edit it, and press Enter again.
Closing the command line
To close the command line window, type "exit" and press Enter. The window will close. You can also straightforward click the X button in the top right corner of the window, though typing "exit" is cleaner because it closes any background processes the command line might be running.
If you have typed a command but not pressed Enter yet, pressing Ctrl+C will cancel that command and show you a new prompt. This is useful if you change your mind or realize you made a mistake before pressing Enter.
Frequently Asked Questions
Can I have multiple command line windows open at the same time?
Yes. You can open as many command line windows as you want by repeating the steps above. Each window is independent, so you can run different commands in each one. This is useful if you need to work in multiple folders or run multiple tasks at once.
What if I type a command and nothing happens?
Some commands take time to run, so wait a few seconds before assuming something is wrong. If you see a blinking cursor and no new prompt, the command is still running. If you want to stop it, press Ctrl+C. If you see an error message, check that you typed the command correctly and that the file or program you are trying to access actually exists.
Is it safe to use the command line?
The command line is safe as long as you type commands you understand or copy them from a source you trust. Some commands can delete files or change system settings, so avoid typing random commands from the internet. If you are unsure what a command does, search for it first or ask someone before running it.
Why does my command line look different from the examples?
The appearance of the command line depends on your computer's settings and which version of Windows, Mac, or Linux you have. The prompt might be a different color, shape, or format, but it works the same way. As long as you see a prompt and a blinking cursor, your command line is ready to use.
Can I make the command line window bigger or change its appearance?
Yes. You can resize the window by dragging the edges, just like any other window on your computer. On Windows, you can right-click the title bar and select Properties to change the font size, colors, and other settings. On Mac and Linux, the options are usually in the Terminal menu under Preferences or Settings.