Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 35

Chapter 4

Operating System

What is Operating System?

“Operating system acts as an interface between


computer and user”

OS act as translator
User computer

Operating system is a set of programs that is extremely important to activate and


co-ordinate the activities of various hardware resources like the processor and
Input/Output devices. It basically works as a resource manager trying to optimize the use
of these resources. In other words Operating system controls the movement of
information on the computer. You can think of operating system as a policeman who
directs traffic at a busy intersection. In the much same way, Operating system controls
the way the computer uses programs, games and applications. Operating system is the
control system under which all other software functions. It means it is operating system
that is first program to be loaded into the computer before any other processing can be
initiated. Once you have loaded the operating system into your computer’s memory, it
makes it easy for you to use applications and create and manage files on your computer.
It also lets you use devices such as printers, diskette drives and fixed disk drives with the
computer.

There are four major functions of operating system:

(i) Input/Output Management


(ii) Memory Management
(iii) File Management
(iv) Job Control

Operating System Trademarks

MS-DOS Microsoft Inc.


XENIX Microsoft Inc.
UNIX Bell Laboratories
VENIX Venturecom,Inc.
VAX Digital Equipment Corporation
PC/IX IBM Corporation
CP/M Digital Research
DEC Digital Equipment Corporation
4.1 MS-Disk Operating System

MS-DOS stands for Microsoft Disk Operating System , is an operating system that works
like a translator between user and computer .
TYPES OF DOS COMMANDS

There are two types of DOS Commands


INTERNAL COMMANDS

EXTERNAL COMMANDS

INTERNAL COMMANDS are the simplest ,most commonly used commands and
execute immediately because they are part of a file named COMMAND.COM .when you
list the directory of your DOS Diskette the internal commands are not seen. Once DOS is
loaded, there is no need for the DOS Diskette in a drive to use these commands.
Following is a list of DOS INTERNAL COMMANDS

BREAK,CHDIR,CLS,
COPY,DATE,DEL,ECHO,EXIT,FOR,GOTO,IF,MKDIR,PATH,PAUSE,PROMPT,RE
M,REN,RMDIR,SET,SHIFT,TIME,TYPE,VER,VERIFY,VOL.

EXTERNAL COMMANDS

Any file name with an extension of .COM, .EXE, or .BAT is considered as EXTERNAL
COMMAND. This allows developing your own unique commands and adding them to
system. These commands are on disks as program files/They must read from the disk
before they are executed i.e. the disk containing the command must be in a drive
otherwise DOS is unable to find the command.

When you select an external command you do not have to include the file name
extension.

If you have more than one external command with the same name, DOS will run only
one of them according to the following order of precedence: .com, .exe, .bat.

Following is the list of DOS EXTERNAL COMMANDS

APPEND,ASSIGN,ATTRIB,BACKUP,CHKDSK,COMMAND,DISKCOPY,DISKCOM
P,EXE2BIN,FDISK,FIND,FORMAT,GRAFTABLE,GRAPHICS,JOIN,LABEL,MODE,
MORE,PRINT,RECOVER,REPLACE,RESTORE,SHARE,SORT,SYS,TREE,XCOPY,
MEM.
GUIDELINES FOR DOS COMMANDS

The following information applies to all DOS commands:

• The DOS prompt consist of the default drive letter and the character “>” .For
example C :\> is the DOS prompt for hard disk, A:\> ,B:\> for floppy disk.
• Commands are usually followed by one or more parameters.
• When a command has finished executing, the DOS prompt reappears on the
screen. If no error messages appear before the DOS prompts returns, the
command has been executed successfully.
• You can type commands in uppercase or lowercase or a combination of both.
• Commands start executing only after you press the Enter key.
• Drives are referred to as source drives and target drives .A source drive you
transfer information from. A target drive is the drive you transfer information to.
• DOS searches the current directory of the drive you specify or the default drive (if
you don’t specify a drive) to find an external command. If not found, and you
have specified a path command, DOS searches the directories listed in the PATH.
• Commands that allow you to enter file names can accept a path (directory) name
before the file name.
• Commands and parameters must be separated by delimiters. A delimiter may be
any of the following –comma, space, semicolon, equal sign or the tab key; the
delimiters can be different with in one command.
For e.g. REN, VIJAY.COB=BIJOY.COB
• To stop a command while it is executing ,press CTRL+BREAK .This command is
recognized only while the system is reading from the keyboard or printing
characters on the screen, unless you have break =on in your CONFIG.SYS file or
have issued a BREAK ON command may not end immediately when use
CTRL+BREAK.
• If you type any of these characters<,> or |in a command, DOS treats them as
redirection and piping characters.
DOS COMMANDS

DATE :-This command (internal) permits you to enter or change


the date known to the system. Whenever you create or
add to a file the date is recorded in the directory.

Its syntax is

DATE[mm/dd/yy]

mm, dd, yy specifies month ,day and year respectively. when you type the date,
allowed numbers are mm-1 to 12 dd – 1 to 31 yy – 1980-2099

If you type DATE with no parameters, the following prompt is displayed.

Current date is week day mm-dd-yy


Enter new date (mm-dd-yy):_

Separate the parts of the date with a hyphen (-) or a slash (/) e.g. to set the date to
Feb, 7, 1978 type:

7-02-78 or 7/02/78

If you type a valid date, the new date is accepted and the DOS prompt is
displayed .if the date is invalid, the following prompt is displayed:

Invalid Date
Enter new date (mm-dd-yy) :

To leave the date as is, press Enter.

Remember when you start the system; it does not prompt you for the date if you
use an AUTOEXEC.BAT file. You can include a DATE command in that file.
TIME This command (internal) permits you to enter or
change the time to known to the system. when ever you create or add to a file ,the
time is recorded in the directory.

Its format is

TIME[hh:mm:[ss[xx]]]

Hh,mm,ss & xx specifies th hours ,minutes and seconds and hundredths of a


second respectively .when you type the time ,allowed number are :
Hh=0-23, mm=0-59 ,ss=0-59 ,xx=0-99 .
If you type TIME with no parameters , the following prompt is displayed:

Current time is hh:mm:ss:xx


Enter new time_

To leave the time as is press ENTER .To change the time, type the new time and
press ENTER.
Separate the hours, minutes and seconds using a colon(; ),separate the seconds
and of a seconds with a period(.).
If you type a valid time,the new time is accepted and the DOS prompt is
displayed. If the time is invalid, the following prompt is displayed:

Invalid time
Enter new time:_

Remember when you start the system, it does not prompt you for the time if you
use and AUTOEXEC.BAT file. you can include a TIME command in that file.

CLS This command (internal) clears the terminal screen.

Its format is

C:\>CLS

VER :This command (internal) displays the M-DOS


version number that you are working with on the
standard output device

Its format is

C:\>VER

The MS-DOS version consists of as single-digit major version number, followed


by a period, followed by a two digit minor version number.

If you want to know that version of a MS-DOS you are using, you simply type the
VER command and press Enter, the following message is displayed:
C:\>VER
MS-DOS 6.2

Microsoft Disk operating system version 6.2

The major version is 6 and minor version is 2


: This command (internal) displays the disk volume
VOL
label or volume ID of the specified drive, if it exists.

Its syntax is

VOL [ drive:]

If you do not specify a drive letter, MS-DOS displays the volume label of the disk
in the default drive.

To display the volume label of driveA. T ype :

C> VOL A:
Volume in drive A is IEC – DOS

If drive A has no label, the result is

Volume in drive A has no label.

DIR This command ( internal ) lists the files and the sub
directories in a directory.

Its format is

DIR [d:] [ path ] [ filename[.ext] ] [/P] [/W]

[d:] [ path ] [filename [.ext] ] specifies the file whose directory you want to list

/P : switch is used to pause the display when screen is full with the following
prompt:

Strike a key when ready…

To resume scrolling the display, press any key

/W : switch displays the information in a wide display format .


MS-DOS displays only filenames ( upto 5 files per line) and not other file
information.

The information provided in the directory listing includes the volume


identification and the amount of free space on the disk. The display line for each
file includes its size in decimal bytes and the date and time the file was last
written to.
You can use the global characters ? and * (also called wild cards)in the file name
ands extension parameters. ( A question mark {?} in a filename or filename
extension means that any character can occupy that position. An asterisk {* }
used in a filename or filename extension means that any characters can occupy
that position or any of the remaining positions in the filename or extension)

To display the directory entry for a file that does not have an extension , type the
filename followed by a period. e.g

C> DIR ABC

To display all the file having extension .BAK of drive B


Type

C> DIR B: *.BAK


Or
C> DIR *.BAK

If your working drive is A and you want to list all the directory entries for the
directory path C:\ COBOL, Type the following command

A> DIR C:\COBOL

The screen will look like this

Volume in drive C is IEC


Directory of C:\COBOL

< DIR> 1-01-80 1:30 PM


.. < DIR> 1-01-80 1:35 PM
VIP COB 2463 7-30-86 8:55AM

3 File(s) 642956 bytes free

Note that the entire file in directory COBOL has been listed, including the two
special entries found in all subdirectories. The entry marked with a single period
denotes the directory being listed (COBOL) , and the double period denotes this
directory’s parent directory ( in this case , the root directory )

Thus, if your current directory is COBOL and you wish to see the files in its
parent directory, you can enter:

C> DIR
COPY
: This command (internal) copies one or more files to
another disk.

Its format is

COPY [drive:] [path] filename [drive:] [path] [ filename [.ext]][/A][/B][/V]

Or

COPY[path] filename[.ext]+ [path] filename[.ext]….[path]filename[.ext]


[/A][/B][/V]

The first file specified is the source file. The second file specified is the target file.
If the second parameter is a directory [ path with no filename], files are copied
into that directory without changing their names. E.g

C>COPY ABC.COB B:

If the original file is on a default drive and you do not specify the second path
name, the copy command is not performed and the MS-DOS displays the
following message

File cannot be copied onto itself


0 file(s) copied

If the second option is a filename only, MS-DOS copies the original file to one on
the default drive and renames it with the specified filename e.g.

C>COPY VIP.COB VVV.COB

If the second option includes a drive name and filename, MS-DOS copies the
original file to one on the specified drive with specified file name, e.g.

C>COPY VIP.COB B:VVV.COB

You can also append files using the copy command. To do so you simply list any
number of files each separated by a (+) sign and specify a target file to send the
combined file to, e.g.

C>COPY XYZ.DOC + ABC.DOC PPP.DOC

This command combines filename XYZ.DOC and ABC.DOC and places them
into a file called PPP.DOC on the same drive. Here if you do not specify the
target file , the MS-DOS combines the file into the first specified file.
You can use the global characters ? and * in the filename and in the extension of
both the source and target files.

C>COPY *.* B:

Copies all types of files in the current directory from the default drive C to B,
with no changes in the filenames or in the extensions. If you use a wildcard in the
source filename or extension, the names of the files will be displayed as the files
are being copied.

The /V switch causes MS-DOS to verify that the sectors written on the target disk
are recorded properly. Although errors in recording data are very rare, this option
lets you verify that critical data has been correctly recorded. It also makes the
copy command to run more slowly , due to the additional overhead of verification
.
The /A and /B switches indicate the amount of data to be processed by the copy
command.

When used with a source filename:

/A causes the file to be treated as an ASCII ( TEXT ) file. The files’s data is
copied up to , but not including, the first end- of –file character found in the file
and the remainder of the file is not copied.

/B causes the entire file to be copied.

When used with a target filename:

/A causes an end –of- file character ( e.g. ctrl-Z ) to be added as the last character
of the file.

/B causes no end –of- file character to be added.

RENAME : This command ( internal ) changes the name of the


file specified in the first parameter to the name and
extension given in the second parameter.

Its format is

REN[NAME] [D:] [PATH] filename[.ext] filename[.ext]

A path can be specified only with the first filename i.e. the file will remain in the
same directory after its name has been changed. e.g.
C>REN B:MAIN.PRG TIME.PRG

Renames the file MAIN.PRG on drive B to TIME.PRG

You can also use the global characters ? and * in the parameters, e.g the following
example renames all the files having extension .BAK in the directory \COBOL
on the drive C to the extension .COB.

A>REN C:\COBOL\*.BAK *.COB

DEL : This command ( internal ) deletes the files


specified by the drive and path name.

Its format is

DEL [d:] [path]filename[.ext]

If you do not specify the drive name, the current working drive is assumed i.e. the
files will be deleted from the current working directory.

If the path name is omitted, the current directory is assumed.

If you specify only the drive or the drive and path and omit the filename, all the
files in the specified directory will be deleted, e.g the following command deletes
all the files from the directory \TEMP on drive C

A>DEL C:\TEMP

You cannot delete files that are marked READ ONLY.

Do not use DEL command to delete a subdirectory

You can use the global filename characters ? and * in the filename and extension.
e.g.

A>DEL *.BAK

Deletes all the files having extension .BAK on the drive A

If you want to delete all the files the files in a directory use *.*, e.g

A>DEL *.*

A message Are you sure (Y/N)? is displayed to verify that you actually want to
delete files. Type Y ( YES) if you want to delete all the files , otherwise type
N( No)

TYPE : This command ( internal) displays the contents of a


text file on the screen.
Its syntax is

TYPE [d:][path]filename[.ext]

Using this command you can view text file without modifying it

You can redirect the output to a file or the printer e.g the following command
prints the contents of the file JAY.COB to the printer

C>TYPE JAY.COB> PRN

If you want to redirect the output to a file, use filename instead of PRN.

Global filename characters are not allowed in the filename or extension

If you try to display a binary file, you may see strange characters on the screen ,
including bells, form feeds etc.

MKDIR : This command (internal) creates a subdirectory in


the specified disk.

Its format is

MKDIR[d:]path

Or

MD[D:]path

If you omit the drive letter of the disk, the default (current) disk is assumed

Path specifies the path of subdirectory names, i.e. when you create directories
with MKDIR , they always appear under your working directory unless you
explicitly specify a different path with the MKDIR command. All characters, that
are valid for file name , are valid for directory name, e.g

C>MD\FORTRAN
This command will create a subdirectory namely FORTRAN under the root
directory of drive C:\> .The following command creates the subdirectory ABC
under the subdirectory FORTRAN
C>MD\FORTRAN\ABC
You can create as many directories as you wish limited only by available disk
space. But be sure that the maximum length of any single of any single path from
the root directory to the desired level is no more than 63 characters, including
embedded backslashes.
Two or more files or directory can have the same name as long as they are defined
in separate directories.

CHDIR : This command changes the DOS current directory of


the specified or default drive or displays the working
directory.

Its syntax is

CHDIR[d:][path] OR CD[d:][path]

[d:] specifies the disk drive whose current directory you want to change or
display. If you don’t specify a drive ,the default drive is assumed.
[path] specifies the desired directory path name .The path name can’t be more
than 63 characters starting from he root directory.

If you type CHDIR or CD with no parameter the working directory path of the
default drive is displayed. E.g. If your current directory is\COBOL of drive C the
following command

C:\>CD or C:\>CHDIR
Will displays C:\COBOL > i.e. the working directory

The following command changes the current directory of the default drive to its
roots directory.

C:\>CD\
The following command always put you in the parent directory of your working
directory.

C:\>CD..
The following command always put you in the previous directory.

: This internal command removes a subdirectory


RMDIR from the specified disk.

Its format is
RMDIR [d:][path] or RD [d:][path]

With the execution of “.” And “..” entries, the directory you want to remove must
be empty. The root directory, the working directory or the directory that contains
the hidden files can’t be removed.

Suppose you want to remove a directory named C:\DOS\TEMP, first ensure hat
the directory is empty and then type the following command

C:\>RD DOS\TEMP

The last directory name in the path is the directory (i.e. TEMP) is removed.

: This external command copies the contents of the


DISKCOPYD diskette in the source drive to the diskette in the target
drive. If the target diskette is unformatted, during the copy the disk is formatted.
Always remember the DISKCOPY destroys the contents of the target drive.
DISKCOPY does not recognize a fixed disk drive.
Its format is

[d:][path] DISKCOPY [d:[d:]][/1]

[d:][path] before DISKCOPY specifies the drive and path that contains the
DISKCOPY command file

[d:] specifies the source drive


[d:] specifies a target drive
/1 option is used to copy only the first side of the diskette, regardless of the
diskette or drive type.

On a one physical drive, a one drive copy operation is performed and in this case
you are prompted to insert the diskettes at the appropriate time and requested to
press any key before continuing.

After copying, DISKCOPY prompts:

Copy another (Y/N)?_

To end the DISKCOPY process, press N, otherwise if you press Y, the next copy
is done on the same drives that you originally specified.

XCOPY : This command copies files, subdirectories and lower level


directories if they exists.

Its syntax is

XCOPY [d:][path][filename][d:][path][filename][/A][/D:date][/E][/M][/P][/S][/V][/W]
The first [d:][path][filename] specifies the source drive, file or directory that you
want to copy to start with which may b a drive ,a path , a filename or any other
combination of these. The second [d:][path][filename] specifies the target drive,
path and filename.

/A Copies only those files which have the archive bit of the attribute set to one.
(To set the archived attribute, see ATTRIB command). The attribute of the source
file is not changed.

/D Copies those files whose date is the same or later than the date specified.

/E Copies any subdirectories, even if they are empty.

/P Prompts you before copying each file to let you confirm whether you want to
create each target file with the following prompt:

d:path\ filename.ext(Y/N)?

/S Copies directories and lower level subdirectories unless they are empty.
Omission of this switch copies only a single directory.

While using XCOPY always remember the following points

1. If the path is not specified, XCOPY starts from the current directory
2. The default directory is *.*
3. If the specified target path does not exist on the target, XCOPY creates the
directories before copying files to the target.
4. You can specify file names just like the copy command ,this allow you to
rename files on the target.
5. The drive path ,filename and extension string should not be longer than 63
characters .
6. XCOPY cannot copy hidden files from the source and cannot copy to read-only
files on the target.

: This command formats to the specified disk.


FORMATISK Formatting analyzes the entire disk for any defective
tracks; and prepares the disk to accept MSDOS files by initializing the directory,
File Allocation Table and system loader. You must use this command to format
all new disks before MS-DOS can use them. Be careful before formatting any
disk, particularly a fixed disk because formatting destroys all data on this disk.

Its syntax is
[d:][path]FORMAT d: [/1][/4][/8][/V]
[d:][path] before FORMAT specifies the drive and path that contains the
FORMAT command file

d: specifies the drive that contains the disk you want to format.

/1 formats the disk for single –side use ,even if the disk or drive is double
sided. If you omit this option while formatting in a double sided drive, you
won’t be able to use the formatted disk on a single sided drive.
/4 formats a single sided or double sided diskette in a high –capacity disk
drive (1.2MB).But the diskette formatted with the /4 parameter so
specified may not be reliably read or written in a single or double-sided
drive(5.25) inch drives only.

/V prompts for a volume label after the disk is formatted as:


Enter Volume label (11 characters ,ENTER for none)?

A volume label identifies and can be upto 11 characters in length .The


volume can’t be used in place of files names as input to any of the DOS
commands.

When formatting is complete, FORMAT displays a message showing the


total disk space, any space marked as defective, the total disk space used
by the system, and the space available for your files.

LABEL : This command ( external ) creates, changes or deletes the


volume identification label on a disk .
Its syntax is :

[d:] [path] LABEL [d:] [Volume label]

[d:] [path] before label specifies the drive and path that contains the LABEL
command.

[d:] specifies the drive of the disk you want to label. If you omit this option, the
default drive is assumed.

[Volume label] specifies the volume label ( volume labels are used to identify
the disk
The volume label maybe upto 11 characters in length and contain any character
except tabs and the following characters
* ? / \ , ; : + = < >[]
If you do not specify the volume label, you are prompted with the following
message:

Volume in drive X is xxxxxxxxxxx Volume label (11 characters, ENTER for


none)
If the disk does not already have a volume label, LABEL prompts you with the
Following message.

Volume in drive X has no label


Volume label ( 11 characters, ENTER for none) ?
To give the disk a volume label, type the label you want and press Enter. The
label typed replaces the existing volume label.

To delete a volume label, just press ENTER. LABEL would then prompt you with
a message;

Delete current .volume label (Y/N)


Pressing y and enter deletes the volume label on the disk,otherwise the volume
label stays the same.

COMP : This command compares the content of the first set of


specified files to the second set of specified files.

Its syntax is
[d:][path]COMP[d:][path][filename[.ext][d:][path][filename[.ext]]

[d:][path] before COMP specifies the drive and path that contains the COMP
command file.
[d:][path][filename[.ext]] specifies the first set of file names that you want to
compare.

Global file name characters are allowed in both the filenames e.g.

C:\>COMP A:\*.cob B:\*.bak

Causes that each file that has an extension of .cob from the current directory of
drive A:to be compared with the file of the same name but having extension .bak
from the current directory of drive B.

After a successful comparison ,COMP displays a message:

File compare OK
Compare more files(Y/N)?_

If you want to end COMP processing,type N,otherwise type Y to compare two


more files.

COMP looks for the last byte of the files being compared to assure that it contains
a valid End of Mark. If EOM is not found it display the message

DISKCOMP
: This external command compares the contents of the disk in the source drive to
the disk in the target drive.
Its syntax is

[d:][path]DISKCOMP [d:[d:]][/1][/B]

[d:][path] before DISKCOMP specifies the drive and path that contains the
DISKCOMP command file.
[d:] Specifies the source drive
[d:] specifies the target drive
/1 causes DISKCOMP to compare just the first side of the disk ,even if the
disks and drives that you are using is double-sided.

C:\> DISKCOMP A: B:

If you omit the second parameter ,the default drive is used as the secondary drive.

If you omit both parameter ,a one –drive comparison is performed on the default
drive.You are prompted to insert the diskette at the appropriate time and
DISKCOMP waits for you to press any key before it continues.

If the target disk is not of the same type as the disk in the source
drive,DISKCOMP displays the following message:

Drive types or diskette types not compatible

After a successful comparison the following message is displayed:

Diskette compare OK

But usually you can’t get this message even if you are comparing a diskette with
its back up created by COPY command because the COPY command copies the
same information but places then on the target diskette at different locations from
those locations used on the source diskette and DISKCOMP compares all track on
a track-for-track basis and issues an error message if the tracks are not equal.

DISKCOMP does not recognize virtual or assigned or fixed disk drives.

: This command sets operation modes for devices.


MODE
Its syntax is
[d:][path] MODE n

[d:][path] before MODE specifies the drive & path that contains the MODE
command file.
n specifies one of the following values:
40,80,BW 40,BW 80,CO 40,CO 80 or MONO
40 indicates 40 characters per line.
80 indicates 80 characters per line.
BW and CO refer to color graphics

This is an external command that reads data from the


MORE standard input device, sends one screen of data to the standard
output device and then pauses with the message ---- MORE

Its format is
[d:] [path] MORE
[d:] [path] before MORE specifies the drive specifier and path that contains
the MORE command file..

The MORE command will not work if the disk is full or write protected
because to hold input information until it is displayed, the MORE command
creates a temporary file on the disk. This command is useful for viewing
long files, e.g the following command displays the contents of the file
LONG.COB on screen at a time

C> TYPE LONG.COB MORE


OR
C> MORE < LONG.COB
When the screen is full, the message ----MORE--- appears on the bottom
line, Press any key to see the next screen.

SORT : This external command reads data from the standard


input device, sorts the Data and then writes the sorted data on to your terminal
screen, to a file or to
Another device.

Its syntax is :

[d:] [path] SORT [/R][ /+n]

[d:] [path] before SORT specifies the drive and path that contains the SORT
command file.

/R sorts in reverse (descending) order

/+n is used to start sorting with column n. The n is an integer value. If you
do not specify n, the default is column 1. The maximum file that can be sorted is
63K.
The following command sorts the directory in reverse order

C> DIR │SORT /R


SORT does not distinguish between upper and lower case letters.

Characters are sorted according to their binary value.

The following file reads the UNSORTED.TST, sorts it in ascending order and
then writes
The output to the file SORTED.TXT

C> SORT< UNSORTED.TST> SORTED.TXT

The output file must be different than the input file name.

To sort your directory on file size, type the following command

C> DIR │SORT/+14

Column 14 contains the file size. Similarly to sort the directory on filename
extension , type the following command

C> DIR │SORT/+10

TREE This external command displays all the directory


paths found on the specified drive and optionally lists
the files in the root directory and each sub directory.

Its syntax is:

[d:] [path] TREE [d:] [/F]

[d:] [path] before TREE command specifies the drive and path that contains the
TREE command file.

[d:] after TREE specifies the drive whose directory paths you want to
display, if you omit this option , the default drive is assumed.

[/F] option is used to display the names of files in the root directory and in
all subdirectories.

This command lists the full path of each directory and subdirectory on the
specified drive.

To pause the screen output, use the Pause Screen Function , e.g ( Ctrl-S) or
pipe the output to the MORE filter,e.g
C> TREE B:│MORE
Will display the directory paths of drive B page wise.

The following command prints all the directory paths and names of all files in
the root directory and each subdirectories on drive A
C> TREE A:/F> PRN

BACKUP This external command backs up one


or more files from one disk to another.
Its format is :

[d:] [path] BACKUP d: [path] [filename[.ext]] d: [/S] [/M] [/A]


[/D:mm-dd-yy] [/T:hh:mm:ss] [/F] [/L:filename]

[d:] [path] before BACKUP command specifies the drive and path that
contains the BACKUP command file

d: after BACKUP specifies the drive that contains the files you want to
back up(source)
path][filename[.ext]] specifies the name of the file or files you want to back
up

d: specifies the drive that will contain the backed up files(target)

/S backs up subdirectories also

/M Backs up only those files that have been modified since the last
backup

/A adds the files to be backed up to those already on the backup disk. It


does not erase old files on the back up disk

/D backs up only those files that have been modified on or after the
specified date

/T Formats the targette diskette if it is not already formatted using the


DOS FORMAT command . FORMAT command file must be in the
current directory or in the path specified.

/L Creates a Log file, if filename is not specified, the date default is


BACKUP.LOG stored in the root directory of the source drive. If a log
file already exists, the information is appended to the end of that file.

The disk that contains the file you want to back up is called the source
and the disk where the backup file is placed is called the Target.

Global filename characters are allowed in the filename and extension.

Files can be backedup from


* Hard disk to floppy disk
* Floppy disk to floppy disk
* Floppy disk to hard disk
* Hard disk to hard disk
You must specify the /A parameter if you want to add files to an existing
BACKUP diskette. If the target diskette contains files , BACKUP erases
the files already present in the root directory on the diskette unless you
specify the /A parameter.

If the source or target is removable ( e.g floppy diskette), you are


prompted to insert the source or target diskette in the specified drive.
When BACKUP fills a diskette you are prompted to insert a new diskette.

You should label and number each backup disk in consecutive order
because when the files are restored , you are prompted to insert the
backup diskettes in order.

DOS 3.30 BACKUP stores backed up files more efficiently than DOS
3.20 BACKUP. DOS 3.30 BACKUP creates two files in the root
directory on the target diskette called BACKUP.XXX and
CONTROL.XXX. The BACKUP.XXX file contains all ther files chained
together , and the CONTROL.XXX file will save paths, file names, and
other controlling information.

The example below backs up all the files having extension .ASM from
drive A to drive C.

A> BACKUP A: *.ASM C:

The following example backs up all files from the root directory on drive
C to drive A . If the diskette in drive A is unformatted, BACKUP formats
the diskette before backing up any files.

C> BACKUP C: A:/F

The following example backs up (adds) all files modified on after the 6-25-
86 in the current directory of drive A to the backed up files already on to
the drive C

C>BACKUP A : C: /D: 6-25-86/A


The following example backs up all files from the fixed disk drive C to the
diskette in drive A .
C> BACKUP C:\*.*A:/S

To backup a full 20MB HARD DISK to double sided , 9 sector diskettes


you need approximately 50 floppy diskettes.

RESTORE This command (external) restores one or more


backup files, that were backed up using the BACKUP
command, from one disk to another.
Its format is ;

[d:] [path ] RESTORE d: [d:][path] filename[.ext][/S] [/P][/B:date]


[/A:date][/M] [/N] [/L:time] [/E:time]

[d:][path] before restore specifies the drive and path that contains
the RESTORE command file

d: specifies the drive that contains the BACKUP file (source)


e.g [d:][path] filename[.ext]
or
[d:] [path] filename
[.ext]

specifies where you want to restore the files and what files from the
source you want to restore

/S Restores subdirectories also

/P Prompts for permission to reserve any hidden or read-only files


that match the file specification. You can then choose to restore the file or
not. Read –only is a file attribute that you can set by using the ATTRIB
command .

/B: date Restores only those files that were last modified on or before the
specified date.

/M Restores only those files that have modified or deleted since the
last backup

/N Restores only those files that no longer exist on the target disk

/L: time Restores only those files that were last modified at or later than
the specified date
/E:time Restores only those files that were last modified at or earlier
than the specified date.

-- /B, /A. /N should not be used together.


-- The files being restored must have been placed on the source with the
BACKUP command

-- If you do not specify a path , files are restored to the current


directory. If you specify a path, you must also specify a file name.

-- The files must be restored to the same directory they were in when
BACKUP copied them

Global filename characters are allowed in the filename and extension. If


you use global filename characters, RESTORE prompts you to insert
the next diskette after it has restored all files on the backup diskette that
match the specified filename.

When RESTORE prompts you to insert the source , make sure you insert
the first diskette that might contain the file that you want to restore. If
you are not sure, insert source number1. If the file is not on the diskette
you inserted RESTORE prompts you to insert the next source.

The RESTORE command can restore files from disks of different media
types,e.g

* Hard disk to floppy disk


* Floppy disk to floppy disk
* Floppy disk to hard disk
* Hard disk to hard disk

RESTORE does not restore the IBMBIO.COM, IBMDOS.COM and


COMMAND.COM files. Therefore RESTORE cannot be used to
create a bootable disk

The following example restores files that have a filename extension of


.DAT from the backup diskette in drive A to drive C

C> RESTORE A: C:* .DAT

The following example restores all the files including subdirectories(/S)


on the backup diskette to fixed disk drive C
C> RESTORE A:C:/*.*/s

The following example restores all the files from the backup disk drive C,
and prompts you if any files on drive C have changed since the last backup
or if any files are marked read-only (/P)

A> RESTORE C:/P


RECOVER This command (external) recovers file from a disk that
TREE
has a defective
sector. You can recover the file that contains the bad sector or all the files
on the disk if directory has been damaged. If the CHKDSK command
shows that a sector on your disk is bad, you can used the RECOVER
command to recover the entire disk or just the file containing the bad
sector.

This action causes MS-DOS to read the file sector by sector and to skip
the bad sectors. When MS-DOS finds a bad sector, it marks the sector so
that it no longer allocates your data to that sector. Its format is :

[d:] [path] RECOVER [d:] [path] filename [.ext]


OR
[d:] [path] RECOVER d:

[d:] [path] before RECOVER command specifies the drive and path that contains the
RESTORE command file.

[d:] [path] filename [.ext] specifies the name of the file you want to recover.

First format of RECOVER is used to recover the specified files whereas


the second format recovers all the files

If you do not specify a drive after RECOVER, the default drive is


assumed. If you do not specify the path, the current directory is used. The
following example recovers the file VIRU.ASM from the disk in drive A.

C> RECOVER A: VIRU.ASM

The disk file VIRU.ASM on drive A is read sector by sector , skipping


the bad sectors.

The following example recovers the contents of an entire disk from driveB

A> RECOVER B:

The disk file allocation table on drive B is scanned for chains of allocation
units in the form:
FILE nnnn.REC

nnnn is a sequential number starting with 0001. Each FILE nnnn.REC


points to one of the recovered files on the disk.

ATTRIB This command (external) sets or resets the file attribute for a single file, for
selected files in a directory or for all files in a directory level

Its format is :

[d:] [path] ATTRIB [+R] [+A] [d:] [path] filename [.ext] [/S]

[d:] [path] before ATTRIB specifies the drive and path that contains the
ATTRIB command file.

[+R] sets the read attribute of the specified file to read only.

[-R] removes the read only attribute of the specified file.

[+A] sets the archive attribute of the file

[-A] clears (turns off) of the archive bit of the specified file.

[d:] [path] filename


[.ext] specifies the file whose attribute you want to change. Global filename
characters are allowed.

/S sets to process all files in the specified directory and its subdirectory
( This option works only with MS-DOS ver 3.30)
If the files exist in more than one directory, this parameter can be set.
The following example sets the read only attribute of the file
SINGH.EXE and resets the archive bit.

C> ATTRIB + R –A SINGH.EXE

The following command displays the current setting of the archive bit
and read only attribute for the file SINGH.EXE.

C> ATTRIB SINGH.EXE

The result is
R C:/SINGH.EXE

The following example removes the read only attribute from the file

C> ATTRIB –R SINGH.EXE

Suppose you want to see the XCOPY command to copy all the files in the
default directory of drive A, except for those which have an extension of
.MAP, to drive B. You would type the following commands.

C> ATTRIB +A A:*.*


C> ATTRIB –A A: *.MAP
C>XCOPY A: B:/M

If you see the /M parameter , XCOPY automatically turns off the archive bits
of the files in drive A as it has copied them .

PROMPT This command (internal ) sets a new DOS prompt .


Its format is :
PROMPT [prompt -text]

[prompt -text] specifies the text for the new system prompt. The prompt text can contain
the following special metastrings that are in the form of $c, where c
maybe one or combination of more than one of the following special
metastrings.

$ The $ character
t The time
d The date
p The current directory of the default drive letter
v The version number
n The default drive letter
g The > character
l The < character
b The : character
q The = character
h Backspace; the previous character is erased
e The Escape character
^ The CR LF sequence ( go to the beginning of new line on the display
screen

Any other value for meta strings is treated as a null character and is
ignored by PROMPT.
To reset the prompt to the normal DOS prompt , type PROMPT with no
Parameters

The following example sets the DOS prompt to the message ready

C> PROMPT READY

The following example sets the DOS prompt to the current directory of
the default drive plus the > character

A> PROMPT $p $ g

You can include this statement in an AUTOEXEC.BAT file so that every


time you start DOS , the DOS prompt tells you what directory you are in
( i.e. the current directory)

If the current directory of drive A is /COBOL , the above command


cause the DOS to display the prompt as

A:\ COBOL>

The following example sets the DOS prompt to display the date and time
as follows:

Date = current date


Time = current time

A> PROMPT Date = $d$-- Time=$t

PATH This command (internal) searches specified directories for command or


batch files that were not found by a search of the current directory. PATH
only finds files that can be executed; such as .COM, .EXE, and .BAT
files. It will not find files with any other extension.
Its format is

PATH [drive:] [path] [:[drive:] [path]…]


OR
PATH;

You may specify a list of drives and path names separated by semicolons
so that when you enter a command that is not found in the current
directory of the drive that was specified with the command, MS-DOS
searches the named directories in the sequence you entered them. Note
that the current directory is not changed.
To display the current path, type PATH without any parameter

To reset the search path to null (no extended search path) type PATH
followed by a semicolon. This is the default when DOS is started.

The following example instructs MS-DOS to look in the current directory of the specified
drive , followed by C:\DOS, C:\USER and A:\TOOLS for a command you specify

C> PATH\DOS; \USER;A:\TOOLS

If the command typed is not found in any of the directories specified in PATH, the
following message is displayed.

Bad command or filename

If the path is set as above and you want to see the path, type the following command

C>PATH

The result is

C> \DOS; \USER;A:\TOOLS

The following command resets the path to null

C> PATH;
LINUX

INTRODUCTION TO LINUX

Linux is freely distributed Multitasking, Multi-user Operating system that behaves like
Unix. It was specifically designed for PC(Intel CPU).Linux is an open source code
operating system .it is called as open source code operating system as the source code an
be customize the according to the needs. It is a great operating system ,rich in features
which is adopted from other version of Unix.
Linux is an offshoot of Unix. It is not an unix operating system ,since it does not contain
any licensed code of unix.
Linux is a operating system kernel which comes with a distribution of software.Linux is
ideally suited for application development and experimentation with new language.As
part of distribution software there are several different compliers including C,C++
,Fortran, Pascal ,Lisp ,Ada ,Basic & Small talk .Many of the linux compilers ,tools
debuggers and editors are from free software foundation GNU’s project (GNU a
recursive acronym for GNU’s not UNIX).

HISTORY OF LINUX

Linux was first released in 1991 by Linus torvald at the university of Helsinki.It was
originally developed as a hobby. Linux has some similarities with unix as an Operating
System.,Unix continues to be widely used in commercial environment as lot of versions
have been available for PC but they never had power of operating system for
Minicomputer ,Mainframes and Servers and moreover early commercial unix versions
were costly as compared to PC in which they were supposed run.
This lack of accessibility gives birth to Linux.
In 1980s Richard Stallmand and FSF (Free software foundation) began work on
alternative operating system and developed functional alternatives to every major unix
component except kernel.
In March 1992 ,version 1.0 of kernel came into being ,making of the first official release
of Linux. Linux is popular in today’s generation because of its portability ,open source
code, adding features and fixing problems.
Torvalds keep the kernel as the domain in the world of linux development, and all
services and application run on the top of the kernel and are customized according to
their requirement.
Linux comes in different flavours called as distributors.Each distributors has its own
unique characteristics including different installation methods ,different collection of
features and upgrade path.

CHARACTERISTICS AND CAPABILITIES OF LINUX


I) Open Source Code
II) Multiuser
III) Multitasking
IV) Portability
V) GUI enabled (X windows)

1) Open Source Code :- Linux kernel and most application written for Linux are
available free on the Internet and with no restriction on copying and redistribution of the
software. Linux kernel is distributed under the GNU General Public License (GPL).This
special software license developed by Stallman’s free software foundation ,promotes the
open distribution and open development . Unlike commercial software, where the
original code is unavailable and unalterable, GNU software allows and make possible to
alter and customize the software.

2) Multiuser :- Linux is an multiuser operating system where as all consumer version


of windows and Mac operating system are Single user operating system i.e. only one user
can be logged in and run application at any point of time .But linux allows multiple
simultaneous user to log on to the other system.Linux can be developed as an application
server ,from their desktop computer or terminals ,users can log into a linus server across a
LAN and actually run application on the server instead of on their desktop PC.

3 Multitasking:- It means capability of performing multiple tasks simultaneously. For


e.g. at same point of time system can print a document ,copy a file and dial into the
internet and while the user is comfortably typing in a word processing programs.
Multitasking creates the appearances of simultaneous activity by switching rapidly
between tasks as the demands of those processes dictates.
Linux systems have been much better than windows at multitasking i.e. why it can be
ideal fit for large corporate servers and high powered work stations .Multitasking with
multiple processors greatly increase the number of simultaneous applications a computer
can run smoothly.

4. Poratbility:- Linux has a capability to run on different configuration which helps in


connectivity with other systems and because of its portable nature it is very easy to carry
from one place to another.

5 GUI enabled(X Windows):- X window is a GUI designed at MIT to provide GUI


applications across different platforms. The version X supplied with Linux is called
Xfree86.
Xfree86 supports several different video cards at a number of resolutions, offering a high
resolution graphical interface. The Xfree86 system also includes application development
libraries ,tools and utilities ,which allows programmers to write application in X without
spending in expensive software development kits or libraries.

LINUX DISTRIBUTIONS

Linux is just kernel and to make running applications i.e. linux, all applications are put
together with kernel to produce a functioning system ,Linus torvald has opened the door
for customization and addition of extra features in linux kernel according to their
needs.These flavours are distributors.
Distributors can be built on different versions of the kernel ,can include different sets of
applications,utilities ,tools and driver modules and can offer different installation and
upgrade programs.
At the core all Linux distributions are having same common set of basic
programs,utilities ,libraries and linux distribution now adhere to standards as Linux file
system hierarchy standard(SHS) The majority of linux distributions are freely available
on net but it can be quite large and downloading these software can require high
bandwidth and high configuration computer.So, numerous organizations provide these
distribution on CD-ROM which also contains documentation .There are numerous linux
distributors .Most common are : Red Hat, Slackware, Caledra, S.u.S.E ,Debian and Corel.

Red hat :- It has emerged as the favorite linux distribution for most users.
www.redhat.com .Red hat has gained frame particularly for its tools for installing and
upgrading the operating system and for its well designed system for installing
,uninstalling and tracking software application packages.
You can always download the latest version of Redhat FTP server at ftp.redhat.com

Slackware:- Slackware is still popular distributions for latest developments in slackware


you can visit and download sites from www.slackware.com .The distribution offers a full
range of expected utilities ,tools and application including X windows.Slackware offers
the Apache web server for using linux to set up an internet or internet web site ,as well as
several freely available web browser.
Slackware can be downloaded from number of different FTP and HTTP sites
www.slackware.com/getslack/

Caledra Open Linux:- This distributor sells the supportable commercial linux. The idea
is to offer tested table and supported versions of Linux that appeal to the corporate
market and to application developer who want a secure target distribution of Linux.
Currently caldera open linux distribution comes in two editions :eDesktop 2.4 for
workstation and eServers. It can be downloaded or purchased from the web.

S.u.S.E : It is a popular Linux distribution available primarily in Europe and is offered in


both English and German version. S.u.S.E. Linux supports version for non-intel platforms
as well, including Digital Alpha,the PowerPC and IBM S/360 Enterprise Server.

Debian/GNU: Out of many Linux distributions it is odd man out as it is not owned by
any specific company. Linux is produced by volunteers. The debian distribution is unique
in some ways.they highlight a commitment to giving back any code they generate to the
free software world. They publicise their bugs,making bug reports easy to find and they
won’t include applications in their distribution that don’t match Debian’s definition as
free software.

Corel: It was developed as the first Linux distribution explicitly targeted as a


replacement for Microsoft Windows on the desktop.Corel Linux is built on the Debian
distribution. They add features to Debian Linux and well it as their own distribution.
RED HAT LINUX 7.1 COMMANDS

arch Displays the architecture of the of the machine on which Linux is


running.For example : i586 represents a Pentium –based system , i486 represents an
80486 based computer

$arch

badblocks Checks a device (usually a hard disk ) for bad blocks.

$ badblocks [-0 filename] [-w] device blocks-count

-0 : Specifies a file where results should be written instead of displaying them on the
standard output.
-w : Uses a write test, instead of a read-only ,in which data is written to each block of
the device and then reread from the block.

RED HAT LINUX 7.1 COMMANDS.

Arch: Displays the architecture of the machine on which LINUX is running. For instance,
i586 represents a Pentium based system, i486 represents 80486 based computer and axp
represents LINUX running on an Alpha based computer.
at: Schedules commands to be executed at a specific time. User is prompted for the
command , or he commands can be provided form a file. Each job is added to a schedule
queue and is provided a job number.
At [-q queue] [-f filename] [-1] [-m] [-d job [job …] ] TIME

Where the variables are:

-d job: Deletes a job specified by job number.


-filename: Reads commands to the scheduled form the specified file rather than
prompting for the commands.
-l : Displays commands in the schedule queue ( the TIME argument is ignored )
-m: E mails the user who scheduled the job once the job is finished and includes any
generated output in the body of the message.
-q queue: Specifies the queue to operate on. Queues are specified with a single letter ( a-
z or A-Z ). By default , the a queue is used for at and related commands

Specifying times: Several options exist for specifying time , including these :

HH:MM specifies the hour and minutes , as such as 11:15 or 22:30 AM and PM suffixes
are allowed as in 11:15 AM or 11:30 PM.
Midnight ( 24:00 or 12:00 PM), noon(12:00), and teatime (16:00) are reserved words
specifying the time indicated.
MMDDYY, MM/DD/YY or MM.DD.YY can be used indicate specific dates , as in
022598 or 25.02.98
Now : specifies the current time
Tomorrow : specifies the next day

Using a+ can specify offsets in minutes , hours , days , or weeks from a specified time.
For instance , to schedule a command for noon two days from the current day, you could
use noon +2 days.

atd

Daemon that runs jobs scheduled for later execution by programs such as at and batch

Atd [-1 load ] [-b interval]

Where the variables are:

-b interval: indicates the minimum interval in seconds between the start of two batch
jobs. By default. this is 60 seconds.

-1 load: Specifies a load limit over which scheduled batch jobs will not be run. By
default. this load is 0.8.

atq

Displays jobs scheduled by the command at that are in the schedule queue. This is the
same as at -1.

atq [-q queue]

where the variables are

-q queue: Specifies the queue to operate on. Queue are specified with a single
letter (a-z or A-Z). By default., queue is used for at and related
commands.

Atrm
Remoives specified jobs from the at schedule queue. This is the same as at –d.

Atrm job ( job ….)

Badblocks

checks a device (usually a hard disk) for bad blocks.

Badb1ocks [-0 filename] [-w] device blocks-count

where the variables are:

-0 filename: Specifies a file where results should be written instead of displaying them on
the standard output.
-w: Uses a write test, instead of a read only test, in which data is written to each block of
the device and then reread from the block

You should specify the device using the full Linux ice path, such as /dev/had2 or
/dev/sdb3. The number of blocks on the device is essential (this information be
determined using fdisk).

Do not use the -w flag on devices that contain important data. Data stored on devices
that are checked with the –w flat will get erased during the checking process.

batch

Schedules commands to be executed at a specified time as long as system load levels


permit. User is prompted for the commands, or the commands can be provided from a
file. Each job is added to a schedule queue and is provided a job number.

Batch [-q queue] [- f filename] [-m] TIME

where the variables are

- f filename: Reads the commands to be scheduled form the specified file rather than
prompting for the commands.

-m: E-mails the user who scheduled the job once the job is finished and includes any
generated output in the body of the message.

- queue: Specifies the queue to operate on . Queues are specified with a single default
letter ( a-z or A-Z). By default , the a queue is used for batch.
Specifying times: Several options exist for specifying time, including these :

HH:MM: specifies the hour and minutes , as such as 11:15 or 22:30. AM and PM
suffixes are allowed as in 11:15 AM or 11:30 PM.
Midnight ( 24:00 or 12:00 PM), noon(12:00), and teatime (16:00) are reserved words
specifying the time indicated.

MMDDYY, MM/DD/YY or MM.DD.YY can be used to indicate specific dates , as in


022598 or 25.02.98
Now : specifies the current time
Tomorrow : specifies the next day

Using a+ can specify offsets in minutes , hours , days , or weeks from a specified time.
For instance , to schedule a command for noon two days from the current day, you could
use noon +2 days.
bc

An interactive , arbitrary –precision calculator. Processes all expression sin specified


files as well as prompting user to provide expressions for evaluation.

bc[file…]

The syntax of expressions used by bc is largely based on the C programming language .


Expressions in files provided as arguments are processed before presenting a prompt to
the user for entering additional expressions to be processed.

biff

Notifies users when new arrives and indicates who sent the message.

biff [ny]

You might also like