You are on page 1of 53

Every computer MUST

have an operating system.


What is the Operating System?
The OS is a set of several programs
that starts the computer and
controls all the instructions given to
the computer
An example of an operating system
is Disk Operating System which is
abbreviated by DOS.

DOS is considered now out of


date and Windows 95 replace it.
DOS is designed to work on
personal computers ( PC’s ).
Disk Operating System
DOS

* DOS is a text mode OS for personal


computers.

* There are several versions such as:


2.0, 2.11, ………... 6.2 .
 We have:
1) warm booting ==>
press Ctrl+Alt+Del keys

2) cold booting ==>


turn the power on.
DOS Commands
DOS commands are divided into:
1. Internal Commands: simple and
automatically loaded into the RAM when
booting the system; e.g. DIR, COPY, CD
2. External Commands: are NOT stored in
the command.com file, called when
needed; e.g. FORMAT, PRINT
DOS Prompt
C:\> (Hard Disk)
A:\> (Floppy Disk)

“C” and “A” are called drives


C

Called DOS prompt

A Also called DOS prompt

B Also called DOS prompt


Means that the current
C
working drive is C

We can switch between the drivers


by typing the drive name followed
by
Question: Suppose that the current
working drive is C. How you can
change to drive A?

Answer
C A:

Current What you need


Question: In the current computer
which you see now there are two
drivers (drive A, and drive C).
Assume also the current working
drive is A. What is the instruction
to switch to drive B ?
Answer

Theoretically, the instruction should


be A> B : , but performing this will
give an error message saying that
the drive (Drive B) is not defined
Note that there is only one external
.) drive ( Drive A only)
A command is an instruction to
the operating system.

A computer file is a collection of


related information stored in
one place (on the disk)
DOS contains several hundreds
of commands which facilitate the
use of the computer.
Time Command:
Gives the exact time stored in
the computer. The time format is
hh:mm:ss:xx .
Date Command:
Gives the current date stored in
the computer. The date format is:
mm-dd-yy .
Note:
Any user can change the time and
date of the computer.
 Directory:

it is a good idea to store related files in one


storage area (called directory).

 Directories
give us a good facility to
arrange our files especially when we have
a large number of files.
DIR Command

Gives the name of all the files


stored in the current working
.drive

It can be combined with * and


letters to bring only files which
.you are interested in
* For example we may group all
math111 material under a
directory called MATH111
or we could create a directory
called BasicProg to store all
files written in BASIC
Adirectory may contain
other directories, thus
creating a hierarchy (or tree).
Basic
MS-Word Games CFiles

Math111 Math113
The FORMAT Command
Format is an external command,
therefore the file format.com should
be available.
If you have two drives:
A:\> FORMAT b: <RET>
insert new diskette for drive B:
and strike any key when ready
The FORMAT Command
Formatting …. Format complete

------- bytes total disk space


------- bytes available
Format another diskette (y/n)?
FORMAT (the /s Switch)

The /s switch is used to add the


MS-DOS system files (IO.sys,
MSDOS.sys) and the
Command.com to a diskette or
hard disk. These make a disk
bootable.
A:\> Format B:/s <RET>
Insert new diskette for drive B:
and strike any key when ready

Formatting …… Format is complete


System transferred
--------- bytes total disk space
--------- bytes used by the system
--------- available on disk

Format another (y/n)?


Format (The /v Switch)
Allows you to assign a volume label or
name to a diskette or hard disk, a
volume label is used to identify a disk.
The volume label will be displayed
whenever the DIR command is used
to examine the contents of a disk
A:\> Format b:/s/v
Insert new diskette for drive B:
and strike any key when ready

Formatting …….. Format complete


System Transferred
Volume label (11 characters, ENTER
for none)? Math111
-------- bytes total disk space
-------- bytes used by the system
-------- bytes available on disk
Format another disk (y/n)?
Creating Directories
The MKDIR (or MD for short) is used to
create a directory:
MD [Drive:] path
A:\> MD \math111 <RET>
This will create directory called
math111 as an entry in the root
directory
A:\> MKDIR \programs
creates a directory called programs
as an entry in the root directory
A:\> MD \programs\basic
creates a directory called basic as an
entry in the subdirectory programs
\ Root

math111 programs

basic
Removing Directories

The RMDIR (or RD) is used to remove


a directory
RMDIR [Drive:] path

Before removing a directory it should


be empty of files and sub-
directories.
A:\> RD \math111
Removes the directory named math111
A:\> RD B:\programs\demo
Removes the directory named demo which
is a subdirectory of programs and is
located on drive B:
Moving between Directories
CHDIR (or CD fir short) is used to change
current directory or displays the current
directory’s path
CHDIR [[Drive:] path]

C:\> CD B:\prog\basic
B: \ ===> prog ====> basic
C:\> CD \sub1\sub2
C: \ ===> sub1 ===> sub2

A:\> CHDIR
displays the path to the current directory
A:\> chdir b:
displays the path to the current directory on drive
b:
C:\NT4.0> cd ..
goes one level up in the directory hierarchy (i.e.
goes to the directory NT4.0)
C:\nt4.0\profiles> cd \

(goes to the root directory)


The Copy Command
The COPY command is used to copy
existing files.
COPY
[Drive1:] [path1] SourseFile [.ext]
[Drive2:] [path2] TargetFile [.ext]
The Copy Command

A:\> copy file.txt b: file.txt


copies a file named file.txt from drive
a: to b:
A:\> copy file.txt B:
copies a file named file.txt from drive
a: to drive b:
A:\> copy y.txt \data
copies y.txt to the subdirectory data on
drive a:
A:\> copy file1.txt file2.txt
create a copy of file1.txt called file2.txt
in the same directory
A:\> copy *.dat b:*.dat
copies all files on drive a: which
have the extension dat to drive b:
The Delete Command
The DEL (or ERASE) is used to
delete one or more files.

DEL [Drive:][path]
[Filename[.ext]]
A:\> del a.dat
deletes a file called a.dat from drive a:

A:\> del b: hw1.dat


deletes a file called hw1.dat which is
stored on drive b:
A:\> del B:*.doc
deletes all files on \drive b: which
have the extension doc. If we have
a.doc, a1.doc, ass.doc all of them
will be deleted.
A:\> del *.*
Are you sure (y/n)?
If you type y all files stored on drive
A: will be deleted.
The Undelete Command
Used to undelete a file which has
been deleted:

A:\> Undelete [Drive][Path]


FileName [.ext]
The Undelete Command

C:\> Undelete x.dat

recoves a file called x.dat which has


been deleted from drive c:
C:\> Undelete b:y.doc

Recovers a file called y.doc


which which has been deleted
from drive b:
The Rename Command
The Rename (Ren for short) is used to
change the name of a file.

REN [Drive:][Directory]
filename1 filename2
A:\> REN x.dat y.dat
Changes the name of the file called x to y

A:\> REN a:\books\book1 book2


Changes the name of book1 to book2;
book1 is stored in drive a: in the
subdirectory called books.
The TYPE Command
The Type command used to display
the contents of a file.

TYPE [DRIVE:][Directory]
Filename[.ext]
C:\> Type a.dat
Displays the contents of a file called
a.dat
C:\Type a:file.doc
Displays the contents of a file called
file.doc which is stored on drive a:
The Edit Command

The Edit command is used to


create a file

You might also like