The black window you type commands into puts many people off. Yet it is the command line that lets you do things quickly, precisely and in bulk, which is often impossible with a mouse. Let us thoroughly explain what the terminal and PowerShell are, the basic commands and how to use them at a higher level.

What the command line is

The command line is a text interface for controlling the computer. Instead of clicking with a mouse, you type commands that the computer carries out. The advantage is speed, precision and the ability to automate and repeat things. Professionals use it daily, because with commands you do in a second what would take long through windows.

Terminal, shell and command line: the terms

These words get mixed up, yet they mean slightly different things:

  • The terminal is the window you type into.
  • The shell is the program that processes commands. On Windows it is Command Prompt (cmd) or PowerShell, on Mac and Linux bash or zsh.
  • The command line is the place itself where you type the command.

Put simply: the terminal is the window, the shell is the brain behind it.

Windows: cmd versus PowerShell

On Windows you have two main options. Command Prompt (cmd) is older and simple. PowerShell is modern and far more powerful: it works with objects, handles the management of the whole system and lets you write full scripts. You can conveniently launch both today through the Windows Terminal app.

Basic commands

Here is an overview of the most used commands in cmd, PowerShell and bash (Linux and Mac):

What it doescmd (Windows)PowerShellbash (Linux, Mac)
List a folderdirls or dirls
Change foldercdcdcd
Current foldercdpwdpwd
Make a foldermkdirmkdirmkdir
Copy a filecopyCopy-Itemcp
Move a filemoveMove-Itemmv
Delete a filedelRemove-Itemrm
Clear the screenclsclsclear
Test the networkpingpingping

Higher-level tricks

This is where the command line becomes a powerful tool:

  • History and arrows. The up arrow recalls previous commands, you do not have to retype them.
  • Tab completion. Start typing a name and Tab finishes it.
  • Output redirection. command > file.txt saves the result to a file.
  • Chaining via a pipe. command1 | command2 sends the output of the first as input to the second. This is the basis of advanced work.
  • Running as administrator. Many commands require elevated rights (on Windows “Run as administrator”, on Linux sudo).

PowerShell specifically

PowerShell is exceptional in that it works not just with text but with objects. Commands (so-called cmdlets) have a uniform form, for example Get-Process or Set-Service. They can be chained into work with the whole system. Scripts are saved to .ps1 files.

Automation and scripts

The greatest strength is in automation. You save a sequence of commands into a script (.bat for cmd, .ps1 for PowerShell, .sh for bash) and run it with a single click or schedule it to run by itself. That is how you can do backups, maintenance or bulk file changes.

Watch out for security

One important warning: do not copy commands from the internet blindly. A misunderstood or malicious command can delete data or damage the system, especially with administrator rights. If you are not sure what a command does, check it first.

Want to learn to work more efficiently or automate routine in your company? Get in touch, we will advise and prepare a solution. See also basic Linux commands.