A lot of Windows users have never even touched Command Prompt aka CMD. With today’s advanced operating systems, it’s easy to use the computer without worrying about entering text commands in the Command Prompt.
Join the channel Telegram of the AnonyViet 👉 Link 👈 |
However, you should also be familiar with the Command Prompt in Windows. It helps you interact with the operating system more and can do more useful tasks. So, in this article, I will acquaint you with Command Prompt.
Command Prompt – What is CMD?
Command Prompt, officially known as Windows Command Processor and often abbreviated as CMD, is a command line interface for the Windows operating system. The command line interface is a way of directly interacting with the computer using text commands.
The early days of the computer age, when you had to type commands into a terminal to execute processes. Early PC operating systems, such as MS-DOS, operated exclusively through a command line interface. There are no mouse pointers, window managers or other graphical user interface (GUI) elements as we are used to seeing today.
Another term you should know is “shell”, which is used to describe a program that allows the user to issue commands to the computer. So the command line interface, as well as the GUI, are shells.
Early versions of Windows, such as Windows 3.1, operated as a DOS-based visual interface. Later versions, including Windows 95 through Windows ME, also included MS-DOS.
Starting with Windows XP, Windows broke away from MS-DOS. However, in modern versions of Windows, you can still use the Command Prompt to chat directly with your computer instead of clicking through various graphical menus. Command Prompt can also run batch files, which is a great way to automate tasks.
Advanced users prefer to use the Command Prompt for some tasks, although you can also perform these tasks with a few simple keystrokes, which will require dozens of presses in the GUI interface.
How to open CMD in Windows 10
There are several ways to open Command Prompt in Windows. Here are the most common ways:
Method 1: Type “command prompt” into the Start menu to search. You can also type “cmd” (which stands for Command Prompt) if you want.
Method 2: Press Win + R to open the Run box, then type “cmd” and press Enter to open the box.
Method 3: Press Win + X (or right-click the Start menu) and select Command Prompt. Depending on your Windows installation, you may see Windows PowerShell. PowerShell is more powerful than Command Prompt but still runs all the same commands.
Whichever you use above, open Command Prompt with normal permissions. A lot of useful commands require you to have administrator privileges.
To run Command Prompt as administrator, hold Ctrl + Shift as you launch either of the first two options above. If you use the third option, choose Command Prompt (Admin) instead. The computer will ask you to accept UAC authentication, so you will need to either log in to an administrator account or provide an administrator password.
Command Prompt Basics
When you open the Command Prompt window, you’ll see some basic information about your current version of Windows. Then you will see a line like this:
C:\Users\Username>
This is your current directory location. Any commands you run based on location (such as deleting files) will take place in this directory. The other CMD commands are more generic and do not depend on the current directory location.
It is important to know that when working in the Command Prompt, you must enter the correct commands. Since you’re issuing commands directly to your computer, it won’t understand if you type it wrong.
If you enter a command that your computer doesn’t recognize, you’ll see a message that says [Lệnh] unrecognized… and Windows won’t do anything.
This isn’t really a problem, it saves you the risk of accidentally typing the wrong command or using the command in an unexpected way. For example, when trying to delete a file, you may accidentally tell cmd to delete an entire directory.
The command line will run whatever command you type, as long as it’s valid. So you should always double check what you’re about to do before you start.
Command Prompt Basics for Beginners
There are many Command Prompt commands and most of them are not intuitive for newbies. Learning these commands takes time, so it’s best to slowly build up your knowledge rather than learning to dance.
You can also see more articles about my cmd command here.
How to view command instructions
Command help will list many common commands you can use. This command will also explain each command for you to use, so you don’t need to waste time looking for it.
If you want more specific information on how to use a certain command, type that command and add /?. This option will give you more help, along with additional options to modify how the command works.
List and change directory
Command dirstands for directory, will list the contents of the current directory. As mentioned earlier, you can check the current directory location by looking at the first command on the left.
To change current directory location, use CD (stands for change directory) followed by the directory you want to access. The available directories are highlighted when you run the dir command.
For example, to move to the Desktop folder from the default folder, you would type cd Desktop. And to move back one directory, use the command key CD..
Create, delete files and folders
Use mkdir [tên thư mục mới] to create a new folder. Eg: mkdir Awesome Pics will create a folder called Awesome Pics.
The same, similar, rmdir [tên thư mục] will delete a directory, but only if it is empty. To delete a file, use del [tên tệp].
Manage CMD
If there’s too much clutter on the Command Prompt screen, type cls to delete the command content. And if there is a running command that you want to cancel, press Ctrl + C to end it.
Network test command
Some of the most useful Command Prompt commands are related to networking. Commands like ping allows you to see if your computer can connect to the site and how long it takes. Meanwhile, the command ipconfig allows you to see the network overview of the current connection.
Now you are familiar with the basic commands in Command Prompt, even if you have never used CMD before. Some tasks, such as file and folder management, can be confusing if you’re used to the GUI. But for other tasks, like checking your IP address, running the CMD command is much faster and more convenient than using the GUI.
While most CMD commands are specific to the Windows environment, Windows 10 now also lets you run the Bash shell used by Linux, macOS, and many other operating systems using WSL.