0% found this document useful (0 votes)
82 views

Disk Operating System

DOS is a disk operating system developed by Microsoft in 1980. It classifies commands into internal commands, which are built into COMMAND.COM, and external commands, which are separate files stored on the disk. Some key internal commands include DIR to display files, COPY to copy files, REN to rename files, TYPE to display file contents, and DEL to delete files. External commands include FORMAT to format disks and ATTRIB to view/change file attributes. Files have an 8 character maximum name and 3 character extension to indicate file type like .TXT for text files.

Uploaded by

AnuNeeralgi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Disk Operating System

DOS is a disk operating system developed by Microsoft in 1980. It classifies commands into internal commands, which are built into COMMAND.COM, and external commands, which are separate files stored on the disk. Some key internal commands include DIR to display files, COPY to copy files, REN to rename files, TYPE to display file contents, and DEL to delete files. External commands include FORMAT to format disks and ATTRIB to view/change file attributes. Files have an 8 character maximum name and 3 character extension to indicate file type like .TXT for text files.

Uploaded by

AnuNeeralgi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Disk Operating System

DOS is an acronym for Disk Operating System. It was developed


by Bill Gates and Paul Allen of Microsoft Corporation, USA in
1980. - MS-DOS (Microsoft)

DOS Commands are classified into two types:


1. Internal commands.
2. External commands.
• Internal commands are integral part of the
COMMAND.COM. These are simple routines within
the command processor.

• External commands are stored on disk as a separate


file.
Go to MSDOS from Windows Operating System:
Click Start Button →Choose Program →Choose Accessories →Click Command
Prompt as shown below:

Or Click Start Button ---Choose Run ----Type cmd in the Open tab as shown below:
Command Prompt will get displayed as shown:
Internal Commands
1. DIR - This command displays the list of directories and files. It
shows the name of the directory or file, number of bytes, date and time.
Type DIR at C:\>prompt as shown and then press the ENTER key.
Now, you will find on the screen, a list of files and directories present
in the directory
C:\> (Root directory)
C:\>DIR
2. DIR - Options There are many options associated with DIR command.
Below table illustrates the option and its meaning.

Option Meaning
DIR/P Page wise listing of directories and files

DIR/W Widthwise listing of directories and files

DIR/A Display all directories and files


DIR/B Display in bare format (No heading information and
summary)
DIR/O Listing files in sorted order
DIR/S Display specified files in all directories and subdirectories

DIR/L Display in lowercase letters


DIR/AD Display only directories
DIR/AR Display read-only files
DIR/AH Display only hidden files
DIR/AA Display only files accessible for archiving
3. COPY - This command is used to copy one file to another. It
duplicates the existing file. The syntax is
C:\>copy OldFileName NewFileName
Here, OldFileName is an existing file and NewFileName is the file that
copies the contents of OldFileName.

Examples: i) C:\> copy odd.c ABC.C


ii) C:\> copy exp1.c prg.c

Copying of a file from one directory to another is also possible.


The syntax changes.
copy drive:pathname drive:pathname
Here pathname indicates the location of the file to be copied.
Example: i) C:\> copy C:\DOS\CONFIG.SYS A:\PBK\CONFIG.SYS
ii) C:\> copy C:\TC\bin\sort.c D:\PETiis.c
4. REN - This command is used to rename the existing file.
Its syntax is as follows.

REN FileName1 FileName2

Here, FileName1 is a file present in the directory and is renamed by


FileName2.

Examples:
i) C:\> REN EXP.C PQR1.C
ii) C:\>REN X.DOC Y.LET
iii) C:\> REN COMMAND.COM COMMAND1.COM
5. TYPE - This command is used to display the contents of
a file. Its syntax is as follows.
Type FileName
Examples: i) C:\> Type EXP.CPP
ii) C:\> Type prog.c

6. COPY CON - This command is used to create a new file from the
console. Its syntax is as follows.
COPY CON FileName
Suppose you want to create a file FirstProg.c, and then type it as
C:\> copy con FirstProg.c
• Hit ENTER key.
• The cursor (location marker) moves to the next line.
• Now type whatever the information you want.
• After completion of typing, you can stop it by pressing
simultaneously CTRL and Z keys.
• And, then press ENTER key.
7. MKDIR - This command is used to create new directories.
Its syntax is as follows.
MKDIR DirName
Where, DirName is the name of the new directory to be created.

Examples:
i) C:\> MKDIR CS
ii) D:\> MKDIR XYZ

We can also use MD in place of MKDIR. It also does the same job. MD
stands for Make Directory.
8. CD - CD stands for Change Directory. It changes the environment from one
directory to other.
Its syntax is as follows.
CD DirName
Example:
C:\> CD TC When this command is executed you will find on the screen
C:\TC>
And, if you want to go back to the prior environment then execute CD as
C:\TC>CD..
OR C:\TC>CD\

This brings you back to C:\>(Root directory).


The above commands are used in below window.
9. RD - This command is used to remove or delete the directories.
Before using this command ensures that the directory to be deleted
must be empty. Otherwise the directory will not be deleted. The syntax
is as follows.
RD DirName
Example: C:\> RD XYZ
It deletes the directory XYZ in root directory (i.e. C:\>).

10. DEL - This command is used to delete or erase a file. Its syntax is as
follows.
DEL FileName
Example: C:\> DEL prime.C
The file prime.C is erased from root directory.

11. CLS - This command clears the full screen.


12. DATE - This is used to display the current date or set the new date. Type the
following command
C:\>DATE and press the ENTER key.

13. TIME - This command is used to display the current time or set the new time. Type
the following command.
C:\> TIME and press the ENTER Key.
You will see on the screen:

If you wish to set a new time, type your time in hour -minute-second (HH-MM-SS)
format at the end of the second line. If you don't want to set the new time, simply
press the ENTER Key.
14. VER - This displays the version of DOS installed in the system.
There are different versions of DOS, such as DOS 1.0, DOS 2.0, DOS
4.0, DOS 5.0, DOS 6.0, DOS 6.20, DOS 6.22 and DOS 7.0. Example:
C:\>VER
Rules for naming a file and its Extension
The following rules must be strictly followed while giving a name
to a file.
(a) File names can have a maximum of eight characters from A to Z or 1-
9 or special characters such as: $ & # a 1 % ( )-1 ) ---
(b) File names should not contain any blank character (space) and any of
the following characters: ?/ \ C 3+: 1 < > -
(c) Filenames like autoexec.bat, config.sys are reserved and are to be
used only for specific purposes.
(d) Each extension can contain a maximum of 3 characters. Extension
name is not compulsory but it assists in remembering the type of the
file used.
(e) The following words to be used as extensions because these are
reserved for specific purpose. CON, COX, LPT, PRN, BAS, COM,
BAT, EXE.
(f) Files with extensions EXE, COM, and BAT are called executable files
and should be used only for a very specific purpose.
Types of files in DOS
DOS supports a wide variety of files. The type of the file can be identified with the extension of the file in the
filename. The three letters following the name of the file is called as the extension of the file.

.bak : Used by programs and users to make a copy of an existing file for safety and/or
archive purposes.
.bas : A basic computer-language program file.
.bat : This is used for a batch file. Such a file is a series of commands in mostly plain
English which perform an operation in DOS automatically. They come with some
programs and may also be written by a user to make shortcuts or perform operations
like sorting or backups.
.bin : A binary file.
.c : A file of programming language in the C format
.dat : Used to hold information about a particular aspect of a program or about a particular
operation The latter may update a .dat file to reflect recent changes. Other operations
in the program may then view this file and other .dat files while determining a course
of action
.db These are used by data base programs to hold the users' data information
or .dbf :
.dir : Used to house a directory list, especially for communications programs.
.exe An executable file
External Commands are such short programs or utilities which are available on
floppy / hard disk and are loaded in the memory of the PC when specially asked for.
Some of the external commands that are often used are format, attrib,

1. FORMAT – This command is used to format the disks. Formatting is the process of making the
disks usable with DOS. It also identifies and marks the number of tracks, sectors and cylinders. Its
syntax is as follows.
FORMAT drive: options
2. ATTRIB– This is used to view or change the attributes associated with files such as read only,
hidden, archive and system files.
To make files hidden +H option is used To make files read only, +R option is used The general format
is as follows
ATTRIB [+h] [+r] [-h] [-r]
Exercise 1
1. Create two new subdirectories labeled: PUBLIC and PRIVATE in the C:\Work directory.
Create two subdirectories labeled PROGRAMS and DATAS in the PUBLIC directory . Create
a subdirectory labeled DOCUMENT in the PRIVATE directory.

2. In the DOCUMENT directory create a text file named mylive.txt, and write your
firstname, lastname, birth date in this file.

3. Copy the file mylive.txt to the DATA directory.

4. Rename the file from mylive.txt to your lastname, for example: kowalski.txt.
Exercise 2
1. From the level of the C:\Work directory create a directory labeled LAB, and then create
two subdirectories labeled: LAB2A and LAB3A in the LAB directory.
2. In the LAB3A directory create a subdirectory labeled LAB4.
3. In the LAB2A directory create files: file1.txt and write your firstname and lastname in this
file, file2.txt and write the number of your index in it.
4. Place a data from the files: file1.txt and file2.txt into mydata.txt file.
5. Display the contents of the file mydata.txt.
6. Copy the file mydata.txt to the LAB3 directory renaming it to filescal.txt.
7. Rename the file from mydata.txt to mydata.lst.
8. Enable the "read only" attribute for the file filescal.txt.
9. Enable the "hidden" attribute for the LAB4 directory.
10. Enable "read only" and "hidden" attributes for the file file2.txt."
11. Create a directory: C:\WORK\LABOR.
12. Remove the structure from the LAB directory to the LABOR directory, remember about
the hidden files and directories and the empty directory.
13. Place the information about the structure of the C:\WORK directory in the file inflab.txt,
and the information about the attributes of this structure in the file infolab2.txt.
14. Delete the tree of the C:\WORK\LAB directory.
Exercise 3

1.) Create the following directory tree:

2.) In the directory help create the following files:


help.hlp – this file contains the complete text that is displayed by the command “help” from

the console
copy.hlp – contains the help text for the command copy
date.hlp – contains the help text for the command date
3.) From the directory C:\WINDOWS, copy all .bmp files to the directory images.
Rename the first three files to img1.bmp, img2.bmp und img3.bmp.
Move the other .bmp files from the folder images into the folder trash.
4.) In the directory txt, create the following text files:
test.txt – contains some keywords about the dos-commands you have used so far.
directories.txt – contains a listing of all directories and files you have created so far.
5.) From the directory C:\WINDOWS copy all .log files to the directory log.
Create the file all.log containing the content of all log files. Then move the original .log
files
into the folder trash.
6.) Delete all files from the directory trash and then delete the directory itself.

You might also like