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

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 google.com

DIR

Using DIR Command

CLS

Using CLS Command

CD

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

MD

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

Using MD Command

CD..

This command takes out user from the current directory only.

Using CD.. Command

CD\

Takes out user from all the sub directories directly.

Using CD\ Command

ECHO and TYPE

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

DEL

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

RD

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:

TestNG:

Java Basics:

Java File Handling:

OOPs Concept:

Java Question And Answer:

Java Programs:

Excel:


902total visits,4visits today

Leave a Reply

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