Você está na página 1de 15

IT Workshop

Task 5. Microsoft Disk Operating System (MS-DOS) Commands Introduction: Directory: A catalog for filenames and other directories stored on a disk. i!e: A named collection of data stored on disk, appearing to the user as a single unit. It is a group of related records in a database. In relational database, it is called as Table. "OT#: DOS is not case sensiti$e (i.e. DOS commands can %e entered in uppercase or !o&ercase) Types of DOS Commands MS DOS commands mainl categori!ed into " t pes #. Internal $ommands ". %&ternal $ommands '. Interna! Commands These commands are generall loaded 'hen an operating s stem itself is loaded into the memor . So these commands are stored in computer main memor . %&( DI), $O*+, D%,, )%-, MD, $D, )D, )%- etc. Internal commands are also kno'n as Intrinsic Commands. (. #)terna! Commands . These $ommands are stored in Disk files. Stored in secondar memor like disk. . %&( S+S, T)%%, /$O*+, 0O)MAT, DIS1$O*+, $21DS1, ,A3%, etc. . %&ternal commands are also kno'n as Extrinsic Commands. *o& to start DOS . . . . . . . Start 45 *rograms 45 Accessories 45 $ommand *rompt 6or7 Start 45 )un8 45 enter cmd or command in the te&t bo& i!e "aming Con$entions A filename has " parts( 6a7 *rimar -ame 6b7 Secondar -ame 6%&tension7 A dot 6.7 separates a primar name from e&tension. %&( anitha.doc It is optional to gi9e an e&tension to a filename. #. *rimar name cannot ha9e more than : characters and e&tension can ha9e a ma&imum of ; characters

". A filename can contain the follo'ing characters( . An Alphabet 6A4<7 or 6a4!7 Mechanical B2 Page #

IT Workshop
. A number 6=4>7 . Special $haracters such as ?, @, A, B, C, D, 6, 7, E, F, G, , H etc e&cept I, J,fullstop 6.7 and space 6 7 Interna!+Intrinsic Commands

Directory Manipu!ation Commands of DOS '. DI, command : -urpose: it displa s a list of files or directories present on a disk. Synta): D(K5 DI) L%nter5 It displa s #. *rimar -ame ". %&tension ;. Si!e of each file in b tes M. Date 'hen the file 'as either created or modified last N. Time 'hen the file 'as either created or modified last %&(D(K5 Dir Output:

. . . . .

#): D(K5DI)O* 45 it sho's the contents of the disk page4'ise #): D(K5DI)OP 45 it sho's the contents of the disk 'idth4'ise. It displa s onl filenames not date, time, si!e of file etc. directories are sho'n in sQuare brackets 6R S7. %&( DI)OAT Displa files 'ith specified attributes. %&( DI)OD T same as 'ide but files are list sorted b column. %&( DI)OU T Displa o'ner of the file

(. MD command : -urpose: is used to create 6make7 a director Synta): D(K5MD Ldirector 4name5 #):D:./md S"IST Mechanical B2 Page "

IT Workshop

Output:

#): D(K5MD mech3".mech#45 it creates a sub4director mech# under mech3" director 0. ,D command : -urpose: to remo9e 6delete7 a director Synta): D(K5)D Ldirector 4name5 #): D(K5)D S-IST Output:

Mechanical B2

Page ;

IT Workshop
. "OT#: A director or sub4director has to be empt before remo9ing it.

1. CD command : -urpose: To change director Synta): D(K5$D Ldirector 4name5 #): $(K5$D S-IST 45 it change to S-IST director Output:

$(K5$D S-ISTK$S%K$S%%; Output:

"OT#: D(K5$DK 45 it goes to root director 6from an le9el7 D(K5$D.. 45 it goes onl one le9el up D(K5$D 45 it displa s current director name D(K5$D Ldirector 4name5 45 to change director i!e Manipu!ation Commands of DOS

'. CO-2 command: -urpose: To cop a file Synta): $O*+ Lsource dri9e5 Ldestination file5 #): C:./S"IST.CS#.CS##0/CO-2 S"IST.T3T CS#.T3T Mechanical B2 Page M

IT Workshop
Output:

Synta): $O*+ Lsource dri9e5(Lfile spec#5 Ltarget dri9e5(Lfile spec"5 %&( $(KS"IST.CS#.CS##0/CO-2 CS#.T3T D:.CS#'.T3T

(. D#4 command: -urpose: To delete a file Synta): $(K5D%, Lfilename5 #): $(KS"IST.CS#.CS##0/D#4 CS#.T3T Output: Mechanical B2 Page N

IT Workshop

0. ,#" command : -urpose: To rename a file Synta): $(K5)%- Lold4filename5 Lne'4filename5 #): $(KS"IST.CS#.CS##0/,#" S"IST.T3T CS##0.T3T Output:

Common!y used DOS commands: '. D5T# command : -urpose: It displa s s stem date Synta): $(K5DAT% #): $(KS"IST.CS#.CS##0/D5T#

Mechanical B2

Page V

IT Workshop
Output:

If user enters ne' date, it changes s stem date (. TIM# command : -urpose: It displa s s stem time Synta): $(K5TIM% %&( $(KS"IST.CS#.CS##0/TIM# Output:

If user enters ne' time, it changes s stem time 0. C4S command : -urpose: To clear the screen Synta):C:.C4S %&( $(KS"IST.CS#.CS##0/C4S Output:

1. CO-2 CO" command: -urpose: To create a file at command prompt Synta): $(K5$O*+ $O- Lfilename5 #): $(KS"IST.CS#.CS##0/CO-2 CO" S"IST.T3T Output:

Mechanical B2

Page W

IT Workshop

-ote( *ress $T),X< to sa9e and e&it command (ii). #DIT command 45 to create a file in DOS editor Synta): $(K5%DIT Lfilename5 #): $(KS"IST.CS#.CS##0/ CS##0.T3T

5. T2-# command 45 to 9ie' the contents of a file Synta): $(K5T+*% Lfilename5 . #): $(KS"IST.CS#.CS##0/ T2-# CS##0.T3T it displa s the contents of $S%%;.T/T file on the screen Output:

6. #C*O Command: -urpose: to displa a message on the screen 'hile e&ecuting a set of commands. Synta): $(K5 %cho Lmessage5 #)( $(K5%cho 'elcome to snist Output: &e!come to snist

Mechanical B2

Page :

IT Workshop

#)terna!+#)trinsic Commands (Disk Manipu!ation Commands)


'. O,M5T command : -urpose: It is used for formatting a hard disk or flopp disk Synta): $(K50O)MAT A( #): $(K50O)MAT A(OS 45 'ith this command, all the OS files 6$OMMA-D.$OM and " hidden files7 are copied from the hard disk to the flopp disk. "OT#: This command needs the program file 0O)MAT.$OM 0ormat 45 The organi!ation of disk into tracks and sectors is called 0ormatting. (. C*7DS7 command : -urpose: to check the status of the disk. Synta): $(K5$21DS1 A( "OT#: If no dri9e letter is specified 'ith $21DS1 command, then the currentl acti9e dri9e is checked. ;. 458#4 command( -urpose: A 9olume label to the disk is gi9en at the time of formatting the disk. Synta): $(K5 ,A3%, A( "OT#: This command needs the program file ,A3%,.$OM M. DIS7CO-2 command( -urpose: it copies all the contents of one disk onto the other. Synta): $(K5 DIS1$O*+ A( A( "OT#: '. if there is a single dri9e on the computer, then the same can act as source as 'ell as destination . ". This command needs the program file DIS1$O*+.$OM ;. DIS1$O*+ command 'orks 'ith flopp disk and not 'ith hard disk and both floppies should of same capacit .

Mechanical B2

Page >

IT Workshop

Task 6. 4I"93 Commands


'. !s Command:
#): ? ls 45 it displa s list of files A directories

Output:
Desktop d'helper Music *ublic Templates Documents e&amples.desktop *ictures snist.c Yideos ? ls 4l 45 it displa s list of files A directories 'ith permissions 6r, ', & permissions7

(. mkdir command:44

to create a ne' director

Synta)( @mkdir Ldirector 4name5 #): @mkdir mechb" Output: Desktop d'helper mechb" *ictures snist.c Yideos Documents e&amples.desktop Music *ublic Templates

0. rmdir command:44

to remo9e a director

S nta&( @rmdir Ldirector 4name5 %&( @rmdir mechb" Output: Desktop d'helper Music *ublic Templates Documents e&amples.desktop *ictures snist.c Yideos

1. cd command(

44 to change director

S nta&( @cd Ldirector 4name5 %&( @cd Mech3" cdK 45 to go to root director S nta&( @cdK Mechanical B2 Page #=

IT Workshop
5. rm

command 45 to remo9e a file

S nta&( @rm Lfile4name5 #)( @rm snic.c

Output:
Desktop d'helper Music *ublic Templates Documents e&amples.desktop *ictures snist.c Yideos V. cp

command 45 to cop

a file

Synta): @cp Lfile4name#5 Lfile4name"5 45 it copies contents of file# to file" #): @cp snist.c snis.c 45 it copies contents of snist.c file to snis.c file

Output:
Desktop d'helper Music *ublic snist.c Yideo Documents e&amples.desktop *ictures snis.c Templates

:. m$ command -/ to rename a file


Synta)( @m9 Lfile4name#5 Lfile4name"5 #): D(K5mech3"Kmech#Kmech"5m9 snis.c snist.c Output: Desktop d'helper Music Documents e&amples.desktop *ictures

*ublic snist.c

Templates Yideos

;. cat command -/ to create a file, displa


file and keep 'hole content in ne' file

a file, Zoin " files, Zoin " files and create a ne'

(i). Synta)( @cat5Lfile4name5 45 to create a file #): @cat5 Mech3" %nter the te&t and press L$trlX<5 ke s together to sa9e file. $trlX< ke s tell operating s stem that no more te&t is going to be entered. (ii). Synta): @cat Lfile4name5 45 it displa s the contents of a file #): @cat Mech3"

Mechanical B2

Page ##

IT Workshop
6iii). Synta): @cat Lfile4name#5 Lfile4name"5 45 it concatenates 6Zoins7 " files file#, file" #): @cat Mech3" Mech3# (i$). Synta)( @cat Lfile4name#5 Lfile4name"55Lfile4name;5 45 it concatenates 6Zoins7 " files file#, file" and creates a ne' file 6file;7 and put the 'hole content in ne' file #)( @cat Mech3" Mech3#5Mech

<. $i command 45 to create a file in ,inu& editor 69i editor7


Synta)( @9i Lfilename5 #)( @9i Mech3".t&t "ote: #. (' 6or7 ('C 45 it sa9es a file and still remains in that file ". (Q 6or7 (QC 45 it Quits 9i editor 'ithout sa9ing ;.('Q 6or7 ('QC 6or7 << 45 it sa9es a file and Quits 9i editor

'=. grep command 45 to search for a specified pattern in a file such as a particular
'ord or phase Synta)( @grep Lte&t5 Lfile4name5 #)( @grep S-IS Mech3"

''. sort command 45 to sort the contents of a file


S nta&( @sort Lfile4name5 %&( @sort Mech3"

'(. !p command -/ printing files


S nta&( @lp Lfile4name5 %&( @lp Mech3" %&( @lp Mech3" Mech3# 45 it prints " files -OT%( [ser can print more than # file using single lp command

Mechanical B2

Page #"

IT Workshop

4inu) 9ti!ities:
'. %anner command 45 it makes posters
S nta&( @banner Lte&t5 %&( @banner 1IT

(. ca! command 45 it displa


S nta&( @cal Output: \anuar "=## Su Mo Tu Pe Th 0r Sa

s calendar

# " ; M N V W : > #= ## #" #; #M #N #V #W #: #> "= "# "" "; "M "N "V "W ": "> ;= ;# %&( @cal 45 it displa s current month calendar %&( @cal "==M 45 it displa s all #" months of "==M

0. date command 45 it displa


S nta&( @date To displa current date %&( snistBsnist4desktop(E? date Output: Ped \an #> #"(MV("M S$T "=##

s date A time

1. &>o command 45 it prints the login name of the person on the s


S nta&( @'ho %&( snistBsnist4desktop(E? 'ho Output: ra9i tt W ra9i ptsO= "=##4=#4#> #"(;" 6(=7 "=##4=#4#> #"(;V 6(=.=7

stem

5. tty command -/ it displa


S nta&( @tt Mechanical B2 Page #;

s the name of the terminal

IT Workshop
%&(snistBsnist4desktop(E? tt Output: Ode9OptsO=

6. uname command -/ it displa


S nta&( @uname %&(snistBsnist4desktop(E? uname Output: ,inu&

s name of the current ,inu& s stem

:. #c>o command:
S nta&( @echo Lte&t5 %&( @echo S-IST Output: S-IST

;. p&d command -/ it prints 'orking director


S nta&( @p'd %&( snistBsnist4desktop(E? p'd Output: OhomeOra9i

<. man command -/ it displa


S nta&( @man

s on line help

'=. c!ear command -/ to clear the screen


S nta&( @clear the terminal

''. &c command 45 it displa

s no. of lines, 'ords, characters of a file S nta&( @'c Lfilename5 %&( snistBsnist4desktop(E? 'c snist.c Output: # # : snist.c

Mechanical B2

Page #M

IT Workshop

Mechanical B2

Page #N

Você também pode gostar