As an IT professional, I find myself looking up system information on Windows quite a lot. This OS can be cumbersome to search through sometimes. But you don't always have to use the UI to perform tasks on Windows. Let's go through the top 11 commands used by IT professionals to minimize the time they spend fiddling with the user interface on Windows. We will also see commands that have no equivalent outside the command prompt.
There are two parts to this article. In the first part, I will go through the most basic commands for navigating the system at the command line and manipulating files and folders. Afterward, we will go deeper and get into networking, which is among the main reasons I open the command prompt on most occasions. In the end, I will share with you a trick for navigating the sometimes "wordy" output of some of these commands.
First, open the command prompt and follow along. Depending on the windows version you are using, you can find the executable for the command prompt on your start menu (accessories) or by searching for it on the search bar.
A way that works the same on older or newer versions of Windows is pressing Ctrl + R
and then writing cmd
in the run dialog.
dir
This command lists the contents of the current working directory. To check which directory that is, check the prompt; its default name is the current directory.
cd
Now that we know how to list the contents of our current directory, we might want to navigate to another folder. We use the cd
command for that, with the folder we want to navigate to (which can be a full path) as a parameter. The cd ..
command with navigate back one level.
mkdir
This command creates a directory and takes the new directory's name as a parameter. We delete an empty folder using the rmdir
command.
del
We can use it when we want to delete a file provided as a parameter. Files removed with this command cannot be retrieved from the Recycle Bin.
copy
Example: copy <source> <destination>
This command helps us copy files using the command line. I prefer this approach to using the UI because of its precision, so I will use the command line when dealing with many important files.
ping
Example: ping 8.8.8.8
This command is useful when checking connectivity between IP devices. It takes an IP address or hostname as an argument and sends an echo request message to that location. Pinging can also help with name resolution verification.
Sometimes the ping <hostname>
command will return an IPv6 address; to avoid this, we can use it with the '/4' parameter, which requires IPv4 to ping.
ipconfig
Example: ipconfig /all
This command displays the current TCP/IP configuration. You can use ipconfig with the /all
parameter to display the complete configuration information for all adapters.
Another common usage for the ipconfig
command is with the /release
and /renew
parameters, used to refresh the TCP/IP configuration for all adapters or a single one if specified.
tracert
Example: tracert www.google.com
This tool determines the route path taken to a destination by sending ICMP messages to the destination specified by its parameter.
If you need to provide network latency and packet loss for each router in the resulting list, you need to use the pathping
command. We will not get into that one today.
cls
Example: cls
We have been typing a lot in our command prompt window. The cls
command helps us clear the window and have a fresh start.
help
Example: help
This kind of command is usually the best. When used with no parameters, it returns a list of available system commands with a brief description. We can also use it with a command's name as a parameter to see more information about that command.
systeminfo
This command will display detailed information about the system, hence the name. The command's output contains operating system configuration, security information, product ID, and hardware information.
If you tried to run some of these commands, you might have noticed that sometimes their output it's quite a few lines long.
To tackle this issue, we will use an operator and another command.
The operator we need is the pipe operator (|
). This operator transfers the output from the command on the left to the standard input command to its right. All you need to understand from that is that this operator takes whatever the first command was going to return as output and feeds it as input for the second command.
Two commands that need input are the 'findstr' and the 'clip' command.
findstr
The findstr
command takes a string as a parameter and returns the lines from its input containing that string.
Example: systeminfo | findstr Boot
will return only the line containing the Boot device.
The findstr command is an excellent resource for minimizing time skimming through lines of text in our console window.
clip
The clip
command is very similar to findstr in its usage. But instead of searching for patterns of text, it copies its input to the clipboard.
Even if we can select and copy text from the command prompt on newer systems like Windows 10 or 11, I like using this command because of its precision.
And that's it! You might not be a professional yet, but you are on the right path. The commands listed above have a lot of tricks up their sleeves, but I wanted to give you the least complicated version and way to use them. The important thing is to start using them. After you are comfortable with these basic commands, use the help
command to learn about each one (hint: if the help output is more than one page, press q to exit it).