If you are a Windows user, you might know the term cmd or command line prompt. Cmd is the command-line operating system of Windows. Cmd.exe prompt can be used to make your work very easy. All you need to do is write some commands and tada! All of your work will be done automatically in the Windows operating system. The meaning of all these terms is predefined in the Windows operating system, and when you write the command related to your task, it will be done automatically.
You will not have to do all the hard steps to complete your task. But, how will you use these commands when you are not aware of them? Well, don’t worry, we will guide you on using the Windows command-line operating system with a list of all the useful commands and a detailed description. Let’s get started!
What is a Command-Line Prompt (CMD)?
The command-line prompt or CMD is the built-in command-line operating system in Windows. PowerShell is the more advanced version of CMD in Windows.
A user can use CMD when they don’t want to perform the hectic steps of doing their tasks in Windows. They can easily go with the option of a Command-Line Prompt. All you have to do is write some commands, and the work will be done automatically. Windows is a Graphical User Interface (GUI) based operating system where users interact with the computer through displayed graphics. While in a command-line OS, the user gives instructions to the computer by typing commands and lines of code in the interface, also known as CUI (Character User Interface).
CMD is like a translator between the user and the machine. For example, you are a person who only knows the English language, and your computer is a person who only knows the French language. If you want to communicate with each other, you will need a third person as a translator, who will translate the sentences said by you from English to French and vice versa. In the same way, we have CMD as our translator.
When you write the already-defined commands in the Windows shell, the CMD will convert the commands written by you into the computer-understandable language i.e. the machine language. When the commands you give are converted, your computer machine will interpret what you want to say and will perform the tasks as instructed.
How to Access Command Prompt?
There are several ways to access the command-line interface in the Windows operating system. Some of the ways are mentioned below.
Ways to access command-line prompts:
- You can directly access cmd through the shortcut available in the Windows menu. This is the most commonly used method.
- You can also search in the search bar of Windows.
- Open Task Manager and click on “run a new task”. Type cmd or cmd.exe, and then click on OK. The command prompt will start on your Windows screen.
In the same way, there are several other ways through which you can access cmd and start giving commands to accomplish your tasks.
CMD Commands
We are providing here some of the cmd commands that can be typed in the cmd interface to automate your work.
- Call – This command is used to call a batch file from another batch file.
- Dir – This is one of the most powerful commands in cmd that displays all the files in the directory.
- Cls – cls stands for the clear screen. This command erases all the content from the screen. But the already-fixed attributes remain the same. It is used to clear a console window.
- Color – Do you remember the boring black background and white foreground of cmd. You can change this color scheme on the screen by using this cmd command.
- Exit is the most common and widely used cmd command. This command is used to exit the particular task you have started with cmd.
- Find – It is one of the most important commands of Windows that every user should know. This command can search a string of characters in the file or files.
- Shut down – This command can be used to shut down your computer. One of the benefits of using shutdown in cmd is that you don’t have to browse through the Windows menu to shut down your computer. Sometimes even our Windows start hanging, and in that case, our cursor gets hung on the screen. Then, we can type the shortcut key – Windows key + X for starting the command line prompt and shutting down the computer.
- Title – If you want to change the name of the command prompt window, then this command can be used in cmd. The usage of this command will provide some meaningful name to your cmd window.
- Getmac – This command tells the MAC (Media Control Access) address of all the networks connected with your computer machine. This command is very useful when you need to enter the MAC address somewhere, or you can generally use this command to know the protocols connected with your device.
- Sort – This command can sort the output in a particular manner. The file’s content can also be arranged in any manner, like in reverse order, alphabetical order, and in many other different ways. This command is also very useful in removing duplicate entries from the file.
- Taskkill – This command can terminate a particular process or a working application. All you need to do is enter the task ID of the process or application that you want to terminate. You can access this task ID by using the Tasklist command.
- Tasklist – Tasklist displays the list of all the currently running programs. This also shows the process/Task ID related to every process that can be further used for performing other processes like terminating a particular process. You can also modify this list by adding other pieces of information like what program started the process, the memory allocated to the program, etc.
- Ver – In computing, ver is the short form of the version. The ver command can be used to display the name and the version of the Windows operating system that you are currently using on the screen.
- Time – The time command displays your system’s current time. And it also allows the user to change the system time. You can enter the time in the following format:
hh: mm: ss
where hh stands for the hours, mm stands for a minute, and ss stands for seconds.
- Ftype – In command-line OS, ftype is one of the most vital commands that can be used to get information about a file or files. It can provide information like the file type and its mapping. A single file may be associated with an executable program, and at the same time, other files are also associated with that program.
- Ipconfig – This command can be used to show all information related to your network configuration. And it also refreshes your DHCP and DNS settings. But, if you use this command with other important parameters, you can achieve a lot.
Now, it is possible that you might not be aware of the terms like network configuration, DHCP, and DNS. Don’t worry; we will simplify everything here for you.
Network Configuration
Network configuration means setting the computer’s configuration network. These changes can include assigning IP addresses to hosts, routers, switches, and gateways on the network. It is nothing but the setup of the network in general.
DHCP (Dynamic Host Configuration Protocol)
DHCP (Dynamic Host Configuration Protocol) is a set of predefined rules that apply to Internet protocols for assigning IP addresses and other communication parameters to the devices that are connected to a network. It uses a client-server architecture. It automatically assigns the IP addresses so that we don’t have to assign them manually.
DNS (Domain Name System)
DNS is like the encyclopedia of the Internet. Every network or device that connects with the Internet has its IP address. This IP address is used by devices to search each other on the network. The website’s Domain Name is the name of the website. The DNS system changed the website’s URL address and converted it into the IP address. And the DNS system saves this IP address so that humans don’t have to do the hectic work of memorizing an IP address like 182:125:1:1. The browser uses these IP addresses to load the Internet resources.
So, after reading till now, you are aware of the above-used terms that seem very hi-tech. But, we have summed up everything for you in simple language.
More CMD Commands
- mkdir – This command is used to make a new directory or a sub-directory. The full form of media is making a directory.
- Systeminfo – This displays all the configuration information of the computer. It also displays information about the operating system and the computer’s hardware. It also shows the security information, product ID, and many more.
- Ping – Ping is the command-line operator command that can ping a network. In simple words, this command is used to test whether your computer can connect with other computers and other networks.
- Comp – This command can be used to compare the content of any two files. The files you are comparing can exist in different directories or the same directory. You can compare the specific fields of the two files when you enter the correct parameters. This command can also be used to find duplicate files.
- Attrib – The command line prompt command can display all the attributes of the file or files. This command can also be used to change the file attributes. If this command is used without correct parameters, then it will display file attributes of all the files or files in the current directory.
- Compact – This cmd command can compress/uncompress the files. We can also select a specified directory so that the files added to that direction will be compressed automatically. Using the compact command without parameters will display the compression details of all the files in the current directory.
- copy/xcopy – When you want to copy a folder or files, we use the copy/xcopy command. But, there is a little difference between the two terms. When you use the copy command, you have to give the path of the folder that has to be copied, and it only copies the content of that folder to the directed destination. Whereas the xcopy command will copy the folder itself along with all the contents of the files, but for this purpose, the user needs to enter some parameters.
- Diskcomp – This command compares the content stored in two floppy disks. You can give some parameters to get the desired compared results. When used without parameters, this command will use the current state of the floppy disks to give you the results. This command compares two floppy disks track by track, and it displays the number of tracks that are not identical.
- Disk copy – This command can be used to copy the content of one disk to another floppy disk. When you enter this command, the computer machine will expect you to enter the path of the floppy disk whose content you want to copy. You also need to enter the designated floppy disk. Before starting the process of copying the content in another floppy disk, your machine will check whether the floppy disk in which you are copying the content is formatted or not. If it is not formatted, that diskette will be formatted first, and copying the content will start.
- rmdir – This command can be used to delete a directory. You can not delete the current directory and the directory that contains files. Deleting a directory containing files attrib command can be used with some specified parameters to delete the already-saved files and hidden files in the directory. And then, you can use this command to delete a directory.
- del/erase – This command can delete the files in a current directory. If you use this command with some parameters, you can delete the desired files of your choice.
- Rename – Rename is a command-line prompt command that can rename a file/ directory/ files in a directory.
- Type – This command shows the contents of the text files on the screen. You can only read what is written in the text file. You can not write it or modify it in any way. It is always recommended not to use binary text files because it will display some strange characters on the screen that will be difficult to understand.
- tree – This cmd command displays a graphical structure of the specified directory or drive. This command shows the name of all the files in a directory and the names of all the subdirectories. The tree will return the graphical structure with the current directory or drive if used with parameters.
- Prompt – This cmd command can change the command prompt.
- Chkdsk – This inbuilt cmd command can check disks. Chkdsk stands for check disk. It checks whether a disk is working fine or not. If it is malfunctioning, then the saved data on the drive can be recovered if necessary.
- Diskpart – this command can manage the computer’s drives like volumes, disks, partitions, and virtual hard disks through cmd.
- Label – This cmd command can be used to create, destroy or delete the volume label. The label is the name of a disk. If a user uses this command without parameters, then it will change the name of the current volume/disk, or it can even delete the created disk.
- Mode – This command can change system settings through cmd. It can be used to display system status. We can also change the settings of connected devices. If used without parameters, it will display all the controllable attributes of the interface and the information about all the connected devices.
Conclusion
So, these were some of the most important commands in the command line prompt that can be used to simplify your tasks. Even today, CMD is used by many people to expedite their computer tasks. It saves people from the hectic work of giving commands through the keyboard and moving your arm to point the icons on the screen using the mouse. It automates most of the work. The usage of the Command-line prompt on the Windows operating system is also good to have some hands-on experience with a character user interface (CUI).
CUI is good for a better understanding of an operating system behind the scenes. Several other commands can be used to simplify our other works. You can find these commands on the Internet with a little more research.