Computer Basics -6 || Understanding MS-DOS Commands.

MS-DOS stands for Microsoft Disk Operating System. It was the first command based operating system.

There are two types of Operating System available. CUI(Command User Interface) and GUI(Graphical User Interface).

GUI (Graphical User Interface)

Example of GUI Desktop
Example of GUI Desktop

The normal operating systems like Windows 7, 8, 10, MAC OS are the GUI based OS. Benefits of GUI based OS:

  • These OS have graphics, image, audio, video
  • These OS are multi-tasking.
  • We can use the mouse for navigation and giving instructions to the system.
  • No need to remember the commands for any task
  • Easy to learn and simple to use.

CUI (Command User Interface)

Example of CUI Application
Example of CUI Application

The interface of these OS is like as mentioned above. Key-points of Command based OS:

  • Unlike GUI these are single tasking OS
  • Fully pre-defined Command based OS
  • We can’t use Mouse
  • We have to remember all the commands to use this OS
  • We can’t use Image, audio or video
  • Need to put extra effort to learn and little difficult to use.


MS-DOS also is known as Command Prompt as we have to type command for each action. Below are the steps to open the Command prompt:

Run Dialog Box
Run Dialog Box
  1. Press Windows Key + R
  2. “Run” dialog box will open
  3. Type ‘cmd’ in the Text field
  4. Press Enter Key

Basic Commands in MS-DOS

Whenever we launch ‘cmd’ by default c:\users\username> is appearing on the screen. This statement is called prompt. We have to write all the commands after this prompt. These commands are not case-sensitive.

CommandAction to be perform
DIRTo view the list of all files and folders.
CLSTo Clear the screen.
CD dirNameTo change or Open the dir or folder on command prompt
MD dirNameTo make/create a new directory
CD..To exit from a directory or folder
CD\To exit from all the directories and sub-directories in one go.
EXIT To close the command prompt
ECHOTo create a new file with any file extension .doc, .txt, .xls etc.
TYPETo view the content of any file.
DEL dirNameTo Delete all the files in a directory.
DEL fileNameTo Delete any specific file.
RD dirNameTo Delete any specific empty folder
ipconfigTo get the network information like IP address, Gateway, etc.
ping hostNameTo get the connectivity information over the internet. Like ping


Using DIR Command


Using CLS Command


To use these type of commands we have to use the directory or folder name as well. Like c:>cd folderName

While using such commands where we have to use directory or folder name we can navigate through the entire list of files/folder using TAB key in the current folder.

Also, if a folder or file name contains space between them like My Computer instead of only Computer. Then we have to use folder/file name within double quotes.

  • C:\>cd Computer
  • C:\>cd “My Computer”
CD Command
CD Command

Further we can use any other command in the current folder.

DIR command in current folder
DIR command in current folder


To create any directory use C:\>MD NewDirName. To open the same directory we have to use C:\>CD NewDirName.

Using MD Command


This command takes out user from the current directory only.

Using CD.. Command


Takes out user from all the sub directories directly.

Using CD\ Command


We can create file with any extension using ECHO command.

c:\>ECHO “file content” > filename.extension

C:\ECHO This is a new file. > first.txt

To View the content of the file C:\> TYPE first.txt

Using ECHO and TYPE Command


There are two variations while suing DEL command. If we use DEL command with any file it only deletes that file.

For example, C:\myFolder>DEL test.txt

The above statement will delete only the test.txt file from the folder. But if we use the same command with any directory name it will delete all the files present under that folder. See below example,

C:\>DEL myFolder

Using DEL Command


This command delete any folder if and only if folder is empty. If the folder is not empty it will give an error. See below example:

Using RD Command

Related Links:


Java Basics:

Java File Handling:

OOPs Concept:

Java Question And Answer:

Java Programs:


Leave a Reply

Your email address will not be published. Required fields are marked *

Site Statistics

  • Users online: 0 
  • Visitors today : 8
  • Page views today : 8
  • Total visitors : 51,155
  • Total page view: 70,420

   YouTube ChannelQuora

            Ashok Kumar is working in an IT Company as a QA Consultant. He has started his career as a Test Trainee in manual testing in August 2010. Then he moves towards the automation testing after 4 years. He started learning JAVA and Selenium by self to get the knowledge of automation.

       While learning these tools and working on multiple projects, he found that sometimes people get stuck in live scenarios in their project and they have to do lots of RnD to get out of it. So he decided to start blogging only for such scenarios, where anyone facing any problem in their project, can ask any question or give a solution or you can say an alternate solution to achieve the goal successfully.

Later on, he observed that some people want to learn Java but they have few questions in their mind like how to start Java, whether we should go for the online or offline course. So he started writing tutorials on Java, Jira, Selenium, Excel etc.