Sunteți pe pagina 1din 13

Task 4.

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 . 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 mec01(

Output:

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

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

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

D(K5$D mech3"Kmech#Kmech"

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-3 command: -urpose: To cop a file Synta): $O*+ Lsource dri9e5 Ldestination file5 #): D(K5mech3"Kmech#Kmech"5cop snist.t&t mech.t&t Output:

Synta): $O*+ Lsource dri9e5(Lfile spec#5 Ltarget dri9e5(Lfile spec"5 (. D#4 command: -urpose: To delete a file Synta): D(K5D%, Lfilename5 #): D(K5mech3"Kmech#Kmech"5del mech.t&t Output:

2. ,#" command : -urpose: To rename a file Synta): D(K5)%- Lold4filename5 Lne'4filename5 #): D(K5mech3"Kmech#Kmech"5ren snist.t&t mechb".t&t Output:

. Common!y used DOS commands: '. D5T# command : -urpose: It displa s s stem date Synta): D(K5DAT% #): D(K5mech3"Kmech#Kmech"5date Output:

If user enters ne' date, it changes s stem date (. TIM# command : -urpose: It displa s s stem time Synta): D(K5TIM% %&( #): D(K5mech3"Kmech#Kmech"5time Output:

If user enters ne' time, it changes s stem time 2. C4S command : -urpose: To clear the screen Synta): D(K5$,S Output:

4. CO-3 CO" command : -urpose: To create a file at command prompt Synta): D(K5$O*+ $O- Lfilename5 #): D(K5mech3"Kmech#Kmech" cop con snist.t&t Output:

-ote( *ress $T),V< to sa9e and e&it command (ii). #DIT command 45 to create a file in DOS editor Synta): D(K5%DIT Lfilename5 #): D(K5mech3"Kmech#Kmech" edit snist.t&t .

6. T3-# command 45 to 9ie' the contents of a file Synta): D(K5T+*% Lfilename5 . #): D(K5mech3"Kmech#Kmech" T+*% snist.t&t 45 it displa s the contents of snist.t&t file on the screen Output:

7. #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

#)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*8DS8 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. ;. 451#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. DIS8CO-3 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 .

Task 6. 4I"9: 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 Wideos ? 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 Documents d'helper mechb" e&amples.desktop Music *ictures snist.c Wideos *ublic Templates

2. rmdir command:44

to remo9e a director

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

4. cd command(

44 to change director

S nta&( @cd Ldirector 4name5 %&( @cd Mech3"

cdK 45 to go to root director S nta&( @cdK 6. 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 Wideos X. 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 Wideo 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 Wideos

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


file and keep 'hole content in ne' file

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

(i). Synta)( @cat5Lfile4name5 45 to create a file #): @cat5 Mech3" %nter the te&t and press L$trlV<5 ke s together to sa9e file. $trlV< 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" 6iii). Synta): @cat Lfile4name#5 Lfile4name"5 45 it concatenates 6Yoins7 " files file#, file" #): @cat Mech3" Mech3# (i$). Synta)( @cat Lfile4name#5 Lfile4name"55Lfile4name;5 45 it concatenates 6Yoins7 " 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%( Zser can print more than # file using single lp command

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 X \ : > #= ## #" #; #M #N #X #\ #: #> "= "# "" "; "M "N "X "\ ": "> ;= ;# %&( @cal 45 it displa s current month calendar %&( @cal "==M 45 it displa s all #" months of "==M

2. date command 45 it displa


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

s date A time

4. &0o command 45 it prints the login name of the person on the s


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

stem

6. tty command -/ it displa


S nta&( @tt %&(snistBsnist4desktop(E? tt Output: Ode9OptsO=

s the name of the terminal

7. uname command -/ it displa


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

s name of the current ,inu& s stem

;. #c0o 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

S-ar putea să vă placă și