Command Prompt: Basic Commands You Should Know (cmd)
In Windows, when you open a command prompt, almost always the program that is running is cmd.exe. It’s an enhanced NT derivative of the old DOS-based command.com, which is in turn has similarites with the even older CP/M CCP command interpreter.
In Linux, usually you are running bash in some sort of terminal emulator if you are using it in a graphical environment. (which can vary widely depending on your distro and desktop environment). This stands for “Bourne Again Shell” because it’s an extended version of an earlier “Bourne” shell (sh)1: that’s been standard on Unix for a long time. There’s other “alternative” shells in common use such as csh, ksh, and tcsh.
As the outer layer of an operating system, a shell can be contrasted with the kernel, the operating system’s inmost layer or core of services.
The Windows cmd.exe can be considered a shell as well (as can explorer.exe).
Both the Windows command prompt and all Unix shells have several “built-ins”, or commands that are handled entirely within the shell. This includes some basic commands (such as cd) and many conditional commands and operators that control script flow if a batch file of commands are executed.
However, in both Linux and Windows, the great majority of “commands” that do useful things are in fact external programs that are “called” by the the shell. And that is the primary purpose of a shell, to enable an operator to start programs with specifying arguments for those programs. It’s not really strictly a programming language, it’s just a framework for launching programs.
Table of Contents
Change the Directory / Folder (cd)/ Drive
Use cd \
to go to the top of the directory tree.
If you need to go to a specific folder from this drive run the command CD Folder. The subfolders must be separated by a backslash character: \
.
Use the cd..
command to go one folder up.
If you wanted to change the drive from “C:” to “D:”, type d:
and then press Enter
.
Create a New Directory / Folder (mkdir)
You can make a new folder using the mkdir <your folder name>
(Make Directory) command. The syntax of these commands is mkdir Folder.
To test if it worked, use the dir
command. The newly created folder appears in the list.
If you are working on the “C:” drive and you want to create a new folder in another Drive D called “Google”, type mkdir d:\Google
and then press Enter
.
Clear Screen (cls)
To clear the existing commands in prompts type cls
and press Enter
.
Run software
To run software in cmd, Put your shortcuts or .exe (executable file) in the current path where you can start <softeare name>
You can directly type the system names (not shortcut names)
Common program names include the following:
File Explorer:
explorer
My Computer:
explorer =
or explorer /root,
Task Manager:
taskmgr
Character Map:
charmap
Advanced System Properties (for Path setting):
systempropertiesadvanced
Control Panel:
control
Calculator:
calc
Lists Installed Drivers (driverquery)
Drivers are very important in your PC. Missing a important driver can hamper your work. Use driverquery
command to get a full list of installed drivers in your pc. It’ll help you to find the missing driver.
Networking Information (ipconfig)
ipconfig
will provide you your ip address along with your local network.
List Hardware Information (systeminfo)
Use systeminfo
to know very basic information about your pc’s hardware, like – motherboard, processor & ram.
Check if Server is Reachable (ping)
The ping command sends packets of data to a specific IP address (or domain) on a network and then lets you know how long it took to transmit that data and get a response.
pin
If you get the response properly then the connection of the device is working properly if not a particular server or your online connection is blocking communication between your computer and another.ping <ip or domain>
Scan and Repare System Files (sfc /scannow)
sfc /scannow
will scan and repare windown system files. But you must be run the console as an administrator.
List Currently Running Tusk (tasklist)
Use tasklist
to get currant list of all tasks running on your pc.
S
Shell is a UNIX term for the interactive user interface with an operating system. The shell is the layer of programming that understands and executes the commands a user enters. In some systems, the shell is called a command interpreter. A shell usually implies an interface with a command syntax (think of the DOS operating system and its “C:>” prompts and user commands such as “dir” and “edit”). ↩︎