Home / Tips & Tricks / Command Prompt / 15 Basic commands of Command Prompt

15 Basic commands of Command Prompt

Command Prompt(CMD) has always been an integral part of windows with its classic black and white interface. CMD works with commands and there are simple and easy commands which can navigate and do repetitive tasks in a more elegant way. With the graphical user interface, fewer people are using command prompt but if you learn these basic commands you can do more with your computer and can impress your peers.

Here you will find the cmd commands with their complete syntax and examples oh how they work.

Dir

Dir command lists all the folder in the current directory. Apart from listing all the folders of directory dir command also shows us a serial number of volume and free space in that folder. Go to command prompt and type

dir

Dir command of command prompt. It is one of basic command of cmd.

So Dir commands open the directory of the current folder if you want to take the look of a different directory then you have to type Dir command and location of that folder. Now you can see there are 24 folders and 467gb free space.

dir D:\Learning\Python

Dir command of command prompt. It is one of basic command of cmd.

Tree

Tree command is an extension of dir command. Dir command just lists all the folders but tree commands shows us in graphical format.

tree

tree command of command prompt. It is one of basic command of cmd.
tree

Xcopy

This command helps to copy folder and files. You just have to type this command then-current location of the file and then the new location of the file. Now I want to copy my Python folder from D drive to F drive so the command is:

xcopy D:\Learning\Python F:\

Xcopy command of command prompt. It is one of basic command of cmd.

Del

Del command is for delete purposes. You have to type the command and then locate the folder of that file. Let’s suppose i want to delete the files in F drive so i will type

del F:\ab1.py

Del command of command prompt. It is one of basic command of cmd.

One thing to remember is for files you also have to mention extension name when I just typed bb1 command prompt could not find the file then I have to mention its extension name which was py and boom it deleted the file.

System Info

So now if you want to know the complete information about your computer not just model, ram, but also Hotfixes, Network requirements, or when windows were installed.

systeminfo

System info command of command prompt. It is one of basic command of cmd.

Host name

If you want to know the name of your computer host or is your computer connected to any network this command is just right for you.

hostname

Hostname command of command prompt. It is one of basic command of cmd.

Echo

We can use the Echo command to display a message. When making a batch file and we need an alert warning then echo command comes handy for that purpose. For echo command type echo and then type your message.

echo

Echo command of command prompt. It is one of basic command of cmd.

Explorer

This command opens the windows explorer or your PC’s graphical user interface. This command is very helpful when My Computer icon gets removed or your mouse is not working.

explorer

Explorer command of command prompt. It is one of basic command of cmd.

Time

Time command will simply showtime of your timezone set on your computer. Also, you can edit your computer’s time.

time

Time command of command prompt. It is one of basic command of cmd.

Find

Find command is one of the most helpful commands of command prompt. If you want to search for certain queries in a certain directory this command will help you. For this command to run type find then your search query and finally in which drive you are looking for that search query. Important thing is

find “python” D:\

Find command of command prompt. It is one of basic command of cmd.

File Compare

File compare command is for advance users who wants to compare a file with the option of ASCII comparison. For file compare we type fc command and then add paths of the files of both files.

fc /a D:\dir.png D:\del.png

Task List

Next, we have task list command this command works second to task manager. It shows the running tasks which are running right now on your system.

tasklist

Task List command of command prompt. It is one of basic command of cmd.

Task kill

We have seen task list command which shows a list of running task but if we want to end some task then we have task kill command. For this command to run type taskkill then \im and process name.

taskkill \im notepad.exe

Task kill command of command prompt. It is one of basic command of cmd.

Color

Default color scheme of black background and gray in the foreground but if you like different colors and want to change the color scheme then you can do with this color command.

0=Black8=Gray
1 = Blue9 = Light Blue
2 = GreenA = Light Green
3 = AquaB = Light Aqua
4 = RedC = Light Red
5 = PurpleD = Light Purple
6 = YellowE = Light Yellow
7 = WhiteF = Bright White

So these are the combinations you can change for the command prompt. Command color 0c will have black ground with red writing.

color 0c

Shutdown

A shutdown is very important for computers although you can do shutdown with command prompt too. With the command prompt, you can program to shut down your computer with different time intervals.

shutdown /i

Shutdown command of command prompt. It is one of basic command of cmd.

I hope you will find these commands helpful. If you want to know more about command prompt commands do visit SS64. You will find more syntax and almost every command of cmd there. If you want to learn more about networking commands click here.

10 comments

  1. Fastidious answers in return of this matter with real
    arguments and explaining the whole thing on the topic of that.

  2. It’s an amazing article for all the web people; they will take advantage from
    it I am sure.

  3. This site was… how do I say it? Relevant!! Finally I’ve found something which helped me.
    Thanks!

  4. Hey there this is kind of of off topic but I was wondering if blogs use WYSIWYG
    editors or if you have to manually code with HTML. I’m starting a
    blog soon but have no coding know-how so I wanted to get guidance
    from someone with experience. Any help would be enormously appreciated!
    0mniartist asmr

  5. I feel that is one of the so much important information for me.

    And i am happy studying your article. But wanna statement on few general issues, The website style is great, the articles is truly excellent :
    D. Just right job, cheers 0mniartist asmr

  6. Pretty nice post. I just stumbled upon your blog and wished
    to say that I have really enjoyed surfing around your blog posts.
    In any case I’ll be subscribing to your feed and I hope you write again very soon! asmr 0mniartist

Leave a Reply

Your email address will not be published.