Command Prompt and Terminal Basics for Beginners
The command line lets you control the computer by typing instructions. It can look intimidating, but a few commands cover most everyday tasks. Knowing the basics helps with troubleshooting and lets you do some jobs faster. Only type commands you understand, because some commands can delete files without asking.
Open the tool
- Windows: press the Windows key, type Command Prompt or Terminal, and open it. Windows Terminal may open by default on newer systems.
- Mac: press Command + Space, type Terminal, and press Enter.
Find where you are
On Windows, type cd with no other text to show the current folder. On Mac, type pwd, which means print working directory. The current folder is shown in the prompt on most systems.
List files
- Windows: type dir to list the files and folders.
- Mac: type ls to list them.
Move between folders
Type cd followed by a folder name to move into it, and cd .. to move up one level. On Mac, the same command works. Use the Tab key to complete names automatically, which avoids typing mistakes.
Useful safe commands to learn first
| Task | Windows | Mac |
|---|---|---|
| Show the IP address | ipconfig | ifconfig |
| Test a connection | ping example.com | ping example.com |
| Show system information | systeminfo | system_profiler SPHardwareDataType |
| Check battery report (Windows) | powercfg /batteryreport | Not applicable |
The ping command is useful for checking whether your internet connection works. The ipconfig command shows your current network settings.
Commands to be careful with
- Commands that delete files, such as del on Windows and rm on Mac, cannot be undone from the command line.
- Commands that start with sudo on Mac or run as administrator on Windows change system settings.
- Do not paste commands from websites you do not trust. Read what each command does first.
Frequently asked questions
Do I need to learn the command line?
Most people do not, but a few commands help when troubleshooting networks or checking system information.
How do I copy text into the terminal?
On Windows Terminal, Ctrl + Shift + V pastes. On Mac Terminal, Command + V pastes. Check the app's edit menu for copy options.
For more on the tools that help you troubleshoot, see how to use Task Manager.
Use help for each command
Most Windows commands support a help switch, such as typing the command followed by /?. On Mac and Linux, many commands support --help or the man command, which opens the manual page. Reading the help text before running a command is one of the best habits to build early.
Start with read-only commands
Commands that only display information are a safe place to begin. Practise listing folders, checking network settings and showing system details before you try anything that changes files or settings. Once you are confident, you can move on to tasks such as creating folders and copying files.
Related reading
- How to Start Learning Programming on Your Computer: A practical starting path for learning to code on Windows or Mac: choosing a first language, free tools, a weekly routine and small projects to build.
- How to Choose a Laptop: A Buyer's Guide for 2026: What to look at when buying a laptop: processor, memory, storage, screen, battery and weight, and how to match them to your daily work.
- How to Organize Files and Folders So You Can Find Them: A simple folder system for documents, photos and downloads, with naming rules that make files easy to find on Windows and Mac.