Command Prompt CMD – commands worth knowing
- 19 Jun, 2022
- Lista blogów
Command line or command prompt is a special program that allows the user to type commands for the operating system to execute. The command prompt as the cmd.exe program is a component of almost all Windows systems since the 2000 edition, including the latest Windows 10 and Windows 11. A very similar form also appears in all Linux operating system distributions under the common names command line or terminal.
While in various Linux distributions "getting familiar" with the terminal is one of the most important skills that significantly affect the comfort of managing and using the system (especially in systems such as Debian, Archlinux, or Fedora as opposed to the simpler Ubuntu or Mint), in Windows an average user encounters the command prompt quite rarely.
However, this does not mean it is not worth getting to know the command line better – this minimalist program seems unfriendly and primitive at first glance, but with a bit of goodwill and mastering basic commands, it can significantly speed up some tasks performed on the computer. It is also a great place to learn a bit more about operating systems and how computers work in general – the Windows command prompt operates on a somewhat “deeper” level than typical graphical user interfaces.
How to find the command prompt in Windows?
In Windows XP, you had to use the Run option and then type the program name, i.e., cmd. In newer editions, it is much easier to find and launch the command prompt. Windows 7 is much easier in this regard – just open the Start Menu, then search for the cmd.exe program, and then launch it – the command prompt will appear on the screen. Windows 10 and 11 look identical in this respect – all you have to do is select the program from the list of applications or search for it using the keyboard.
Windows cmd - commands and launching programs
The CMD.exe program is not particularly graphically advanced – it consists of a black background and text displayed on the screen. Various commands can be typed there. Below we present a set of the most useful commands in everyday computer use along with their descriptions and instructions.
Worth knowing: the command prompt does not distinguish between uppercase and lowercase letters in commands, so the command CALC and command calc will be interpreted the same way. However, this matters when renaming files using the command line.
CMD commands - launching programs
With the command prompt, you can launch any program installed on the disk. However, you need to know its location and first navigate to it using the cd command.
cd "C:UsersKey-SoftDesktop
Then the command will display the location change – instead of the default (for example C://users/Key-Soft will appear C:UsersKey-SoftDesktop
And then type
Start program_name.exe
Basic programs do not require specifying a path. Thus, to launch the most basic system applications, it is enough to provide their shortened names. These include, among others:
- calc - basic Windows calculator
- charmap - displays the character map – with its help you can copy special characters (e.g., other alphabets) not found on the keyboard
- explorer - launches the file explorer
- notepad - launches Notepad
- cleanmgr - launches the disk cleanup tool
- control - opens the control panel
- defrag - launches the disk defragmenter – today this is no longer particularly important, but a dozen or so years ago operating systems required regular disk defragmentation
- perfmon - launches a panel with tools for monitoring the condition and performance of the computer. There you will find data concerning the disk, processor, cache memory, etc.
Other CMD commands
- copy file path" – copies the specified file and places its copy in the same folder as the original file. The file path is the address of the file on the disk, for example "C:UsersKeysoftDesktopfile1.jpg" and must be enclosed in quotation marks.
- del file path" – deletes the file from the location.
- dit folder path" – displays files located in the specified folder.
- ipconfig - displays data about the internet connection(s) in the operating system.
- mkdir folder path" – creates a folder in the location specified in the path.
- net user - displays a list of users (profiles) in the operating system along with their permissions
- ping [internet address] – displays the connection time to the server. Interestingly, the command works without the http:// and https:// prefixes – just enter the domain, for example key-soft.pl. In the 90s, when due to much lower computer performance launching a web browser was a proportionally somewhat bigger operation than today, this command was often used to check the internet connection status.
- print file path" – prints the specified file. The function works only with a previously set default printer.
- rename file path" new file name – changes the file name. After the rename command, the file path must be given in quotation marks, then separated by a single space before specifying the new file name.
- systeminfo - displays data about the operating system and computer. The command shows both basic information such as computer name or Windows version and more specialized ones like BIOS version.
- shutdown (commonly called cmd shutdown) – allows management of shutting down or restarting the computer and requires a specific instruction after the basic command – e.g., Shutdown /s will immediately shut down the system, and shutdown /l will log out the active user.
- type text file path" – displays the contents of the text file directly in the command prompt. The command works only with Notepad files, i.e., files whose name ends with the .txt extension.
- date - displays the current date and also allows setting a different one.
- time - works similarly to the aforementioned date command – displays the current time retrieved from the system and allows changing it.
Command prompt - commands related to the CMD interface
- cls - clears the command prompt of previous commands, leaving an empty terminal screen.
- color color - changes the text color in the command prompt. After the color command, you need to enter a number value – for example 0 is black, 1 is blue, 4 red, 5 purple, 7 white – the full list will be shown by the command prompt after entering the basic command.
- exit - closes the command prompt.
