Disk Operating System
Disk Operating System
INTRODUCTION
▪ DOS (Disk Operating System) is an oldest type of Operating System. Disk
Operating System is abbreviated as DOS.
▪ In computer science, a generic term describing any operating system is system
software which is loaded from disk devices when the system is started or
rebooted.
▪ DOS is a single-tasking, single-user operating system with a command-line
interface.
▪ DOS acts on commands. Because DOS is ready to perform when given proper
command hence, it is also known as Command Prompt.
▪ Commands are certain words of English language or short form of English
words.
▪ The meaning of these word or short form is already known to DOS. Since, DOS
recognized these words and hence acts accordingly. These words and short
forms of the English words are better known as commands.
FUNCTIONS OF DOS
▪ DOS works as an Interpreter which establishes a link between hardware and
software.
▪ It translates the commands given by keyboard and mouse in such a language
that can be interpreted by the computer. CPU processes the messages and gives
result and sends them back in the form of messages which are displayed on the
monitor, which we can follow.
▪ The brain of the computer is in the system unit, it means it contains CPU, hard
disk etc. But all these are operated by DOS. And DOS is operated by those
commands which you type on the keyboard.
DOS COMMANDS
▪ We know that a computer works in the presence of an operating system. MS-
DOS is an operating system which runs the computer.
▪ When an operating system runs a computer system, to establish a link between
the user and the hardware, it provides the facility of instructions for the user
through command interpreter.
PAGE-1
FCIT UNIT-02
▪ MS-DOS provides this facility to users through the commands of two types.
These are – Internal commands and External commands.
INTERNAL COMMANDS
▪ These commands are always available with DOS because these commands are
automatically stored in the memory at the time of booting.
▪ All these commands are collected in COMMAND.COM program file.
▪ Hence these commands are always available, until we switch off the computer.
▪ Therefore we can execute the Internal commands whenever we want to.
▪ A few examples of Internal commands are – DIR, RENAME, COPY, TYPE etc.
EXTERNAL COMMANDS
▪ External commands are short programs which are stored either on floppy disk or
hard disk and if needed, they are executed and stored in the memory.
▪ The examples of External commands are– FORMAT, CHKDSK, PRINT, DISKCOPY etc.
C:\> DATE
In this situation the screen will display like the following picture:
If you don't have to change the date, press Enter key. If you want to change the
date, type it in the form of month-day-year.
2. TIME COMMAND
By Time command, you may show the current time or can reset it. For using it, type
the following command:
C:\> TIME
In this situation the screen will appear like the following picture:
PAGE-2
FCIT UNIT-02
If you don't want to change time, press Enter and if you want to change it, type the
correct time.
3. DIR COMMAND
Dir command is one of the internal and basic commands of Disk Operating System.
It is used to show the list of available files and directories on the disk. It can be used
for the following purposes:
1. Projecting the list of content of the original directory.
2. Displaying the list of the content of some specific directory.
3. Displaying the list of contents of a particular drive.
4. Displaying the list intermittently.
5. Displaying the list in width.
Type the following commands on DOS prompt to display your files on the screen:
C :\> DIR
You will view the list of files and sub-directories in the root directory.
Having specified full path after DIR command, you can view the files of other directory
or sub-directory through currently active directory.
To view the list of files of some other drive, suppose you are in C drive and want the
list of directories of A drive, type the following command–
PAGE-3
FCIT UNIT-02
C:\> DIR A :
DIR COMMAND WITH DIFFERENT SWITCHES
We can add switches to display the list in different ways. The DIR command with
switches is as follows -
DIR/AH – Displays the list of hidden files.
DIR/AS – Displays the list of system files.
DIR/S – Lists the directories with their sub-directories and files.
DIR/OA – Lists the directories first.
DIR/ON – Lists the directories and files in alphabetical order (i.e. A to Z)
DIR/O-N – Lists the directories and files in a reverse alphabetical order (i.e. Z to A)
DIR/OD – Lists the files and directories age-wise (older to newer)
DIR/O-D – Lists the files and directories in newer to older way.
4. MD COMMAND
MD command and MKDIR command, both are used to serve the same purpose. These
are internal commands. These are used to make Application Directory or Sub Directory.
For example, if we have to make a directory named newdir on C prompt, we'll type the
same command-
C:\> MD newdir (can use MKDIR in place of MD)
Now, suppose, we have to make one directory, means sub-directory named new inside
newdir we'll give the following commands-
C:\> CD newdir (First we'll enter PRAGYA through CD Command)
C:\newdir> MD new
PAGE-4
FCIT UNIT-02
To deal with this, you type COPY command and type the root filename leaving one space
blank and again leave one more space, then after type the new name of the file to be
copied.
COPY THE FILE IN SAME LOCATION
Suppose you have to prepare a file named demo.txt and you have to name the
copy of the file as demo1.txt, the command will follow like this :
C:\> COPY demo.txt demo1.txt
This command will make a copy of demo.txt which will be named demo1.txt and both
the files will be present in C drive.
7. PATH COMMAND
PATH command is used to show path-set-up. Besides, with its help, you can set a new
PATH. For example, to see current path set up, type PATH command on C Drive and
Press Enter Key.
C:\> PATH = copy paste the required path
PAGE-5
FCIT UNIT-02
If you want to make a list of all those files which start from MONTH and are followed by
two letters and their extension name is .DAT, the following command will be given
as MONTH10.......MONTH99, MONTHLY etc. but it will not show a file like MONTH102.
Star wild card is used to display a group of letters in the filename. Suppose you want to
make a list of those files which have their extension name as .'EXE', you will have to type
the following command:
C:\> DEL*.*
DOS prompt will let you ensure as follows :
All files in directory will be deleted from C drive : Are you sure (Y/N) ?
If you do not want to delete all the files, press N and if you think you don't need any
Suppose you want to delete AGE .DOC file from A drive, you will have to give the
following command :
Suppose you want to delete all the files with extension .BAK, which are on C drive, give
the following command :
PAGE-6
FCIT UNIT-02
Suppose you want to delete all the files with extension name .DOC from drive A, type
For example : If you want to rename a file TEST.txt as RESULT.txt, type the following
command.
Suppose you want to change all the files with extension .txt into .doc extension name,
you can do it by the following command :
^ Z or F6
For example, you want to create a file named PRAGYA and write a message in the file
to send it to somebody. Do like this -
C:\> COPY CON PRAGYA
PRAGYA IS A LEADING NAME IN THE FIELD OF PUBLICATION
^ Z or F6
PAGE-7
FCIT UNIT-02
C:\> MD BILLS
Step 2: In this step, we will create two separate sub-directories. It means OFFICERS and
CLERKS directories in SALARY directory.
C:\> CD SALARY
C:\SALARY> MD OFFICERS
C:\SALARY> MD CLERKS
If you are in OFFICER sub-directory and want to get back straight to the root directory,
type the following command.
If you are in sub-directory CASH and want to get back to sub-directory NORTH, type the
following command :
C:\BILLS\NORTH\CASH> CD..
PAGE-8
FCIT UNIT-02
2. CHKDSK COMMAND
This command is used to get information about the available space in the disk and
memory. It is also used to correct the disorder in the data-structure.To do this, use the
following command :
C:\> CHKDSK
3. XCOPY COMMAND
XCOPY command is a better alternative of COPY command. This command is available
in DOS 3.2 and its latter versions. This command acts quickly and helps you copy entire
directory or sub-directoriy with all the files (excluding system and hidden files).
For example, to copy all the contents of RAHUL directory to the floppy, use the
command as such -
4. DOSKEY COMMAND
The use of DOSKEY command started from DOS version 5.00 and it is available in the
versions released after this. Before using this command, it is to be activated in the
memory. To activate it, type DOSKEY and press
PAGE-9
FCIT UNIT-02
This command is used to store the DOS commands to be used in the DOS prompt in the
memory buffer and with the help of buffer can display them in the same order with the
help of up and down keys. Besides it, the options given in the table can be displayed.
5. TREE COMMAND
You may see the list of directories and files in a tree form. To do so, type TREE at the
DOS prompt as follows -
C:\> TREE
C:\> TREE A:
Both the commands used above display only directories and their sub-directories. If you
want to display files altogether, type the command in this way -
C:\> TREE /F
6. LABEL COMMAND
LABEL command is used to name your drive or diskette. Just type the command to do
this -
C:\> LABEL
When you execute the above command by pressing ENTER key a message appears.
Type the label name and press ENTER in the last line of message.
7. SORT COMMAND
SORT command is filter command of DOS which was included in the 2.00 version of
DOS. This is an external command. SORT command, by intercepting the numeric data
arranges it into alphanumeric order. The normal format of SORT command is like this -
PAGE-10
FCIT UNIT-02
The above given command by arranging the content of the source file in a directed
order copies it to the destination file.
For example, we create a file named ITEM with the help of COPY CON command, in
which you type the text like this -
LUX
RIN
WHEEL
HAIR CARE
NESCAFE
DOVE
After this, it is stored with the help of F6 or CTRL+ Z. Then we type the following
command-
Now the content of the ITEM file having been arranged in alphabetical order is copied
in ITEM1.
8. ATTRIB COMMAND
ATTRIB being an external command, is used to attribute some features, like using this
command you can make a file hidden or set into read only form. The syntax is -
For example, suppose you want to make a file named RAJ hidden, do this -
After having executed this command, you can not find the above file using DIR
command as it has been made hidden.
–H – Cancels the hidden attribute of the file and it is seen again in the displayed list.
PAGE-11
FCIT UNIT-02
9. HELP COMMAND
HELP command was used in 5.00 version of DOS and was extended in 6.00 version. In
both the versions, HELP command displays information regarding the given command.
Its format is-
Example :
HELP DIR
PAGE-12