Upload
pranithathebest
View
225
Download
1
Embed Size (px)
Citation preview
8/13/2019 DOS Commands Notes
1/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 agroup 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 " tpes#. Internal $ommands". %&ternal $ommands
'. Interna! Commands
These commands are generall loaded 'hen an operating sstem itself is loaded into thememor. 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 -ame6b7 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
8/13/2019 DOS Commands Notes
2/15
IT Workshop
A number 6=4>7 Special $haracters such as ?, @, , B, C, , 6, 7, E, F, G, , H etc e&cept , J,fullstop 6.7 and space 6 7
Interna!+Intrinsic Commands
Directory Manipu!ation Commands of DOS
'. DI, command :
urpose: it displas a list of files or directories present on a disk.Synta: D(K5 DI) L%nter5It displas#. *rimar -ame". %&tension;. Si!e of each file in btes. Date 'hen the file 'as either created or modified last
N. Time 'hen the file 'as either created or modified last
%&(D(K5 DirOutput:
#: D(K5DI)* 45 it sho's the contents of the disk page4'ise #: D(K5DI)P 45 it sho's the contents of the disk 'idth4'ise. It displas onl
filenames not date, time, si!e of file etc. directories are sho'n in sQuare brackets 6R 7.
%&( DI)A Displa files 'ith specified attributes. %&( DI)D same as 'ide but files are list sorted b column. %&( DI)U Displa o'ner of the file
. MD command :
urpose: is used to create 6make7 a directorSynta: D(K5MD Ldirector4name5#:D:/md S"IST
Mechanical B2 Page "
8/13/2019 DOS Commands Notes
3/15
IT Workshop
Output:
#: D(K5MD mech3"mech#45 it creates a sub4director mech# under mech3" director
0. ,D command :
urpose: to remo9e 6delete7 a directorSynta: D(K5)D Ldirector4name5
#: D(K5)D S-ISTOutput:
Mechanical B2 Page ;
8/13/2019 DOS Commands Notes
4/15
IT Workshop
"OT#: A director or sub4director has to be empt before remo9ing it.
1. CD command :
urpose:To change directorSynta: D(K5$D Ldirector4name5
#: $(K5$D S-IST 45 it change to S-IST directorOutput:
$(K5$D S-ISTK$S%K$S%%;
Output:
"OT#:
D(K5$DK 45 it goes to root director 6from an le9el7D(K5$D.. 45 it goes onl one le9el upD(K5$D 45 it displas current director nameD(K5$D Ldirector4name5 45 to change director
i!e Manipu!ation Commands of DOS
'. CO2 command:
urpose: To cop a file
Synta: $O*+ Lsource dri9e5 Ldestination file5#: C:/S"ISTCS#CS##0/CO2 S"IST.T3T CS#.T3T
Mechanical B2 Page
8/13/2019 DOS Commands Notes
5/15
IT Workshop
Output:
Synta: $O*+ Lsource dri9e5(Lfile spec#5 Ltarget dri9e5(Lfile spec"5%&( $(KS"ISTCS#CS##0/CO2 CS#.T3T D:CS#'.T3T
. D#4 command:
urpose: To delete a fileSynta: $(K5D% Lfilename5#: $(KS"ISTCS#CS##0/D#4 CS#.T3TOutput:
Mechanical B2 Page N
8/13/2019 DOS Commands Notes
6/15
IT Workshop
0. ,#" command :
urpose: To rename a file
Synta: $(K5)%- Lold4filename5 Lne'4filename5#: $(KS"ISTCS#CS##0/,#" S"IST.T3T CS##0.T3TOutput:
Common!y used DOS commands:
'. DT# command :
urpose: It displas sstem dateSynta: $(K5DAT%#: $(KS"ISTCS#CS##0/DT#
Mechanical B2 Page V
8/13/2019 DOS Commands Notes
7/15
IT Workshop
Output:
If user enters ne' date, it changes sstem date
. TIM# command :
urpose: It displas sstem timeSynta: $(K5TIM%%&($(KS"ISTCS#CS##0/TIM#
Output:
If user enters ne' time, it changes sstem time
0. C4S command :
urpose: Toclear the screenSynta:C:C4S
%&( $(KS"ISTCS#CS##0/C4S
Output:
1. CO2 CO" command:
urpose: To create a file at command promptSynta: $(K5$O*+ $O- Lfilename5#: $(KS"ISTCS#CS##0/CO2 CO" S"IST.T3TOutput:
Mechanical B2 Page W
8/13/2019 DOS Commands Notes
8/15
IT Workshop
-ote( *ress $T)X< to sa9e and e&it command
(ii). #DIT command 45 to create a file in DOS editorSynta: $(K5%DIT Lfilename5
#: $(KS"ISTCS#CS##0/ CS##0.T3T
5. T2# command 45 to 9ie' the contents of a file
Synta: $(K5T+*% Lfilename5 #: $(KS"ISTCS#CS##0/ T2# CS##0.T3T it displas the contents of
$S%%;.T/T file on the screenOutput:
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 snistOutput: &e!come to snist
Mechanical B2 Page :
8/13/2019 DOS Commands Notes
9/15
IT Workshop
#terna!+#trinsic Commands (Disk Manipu!ation
Commands)'. O,MT command :
urpose: It is used for formatting a hard disk or flopp disk
Synta: $(K50O)MAT A(#: $(K50O)MAT A(S 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.$OM0ormat 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 ischecked.
;. 48#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
. DIS7CO2 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 shouldof same capacit.
Mechanical B2 Page >
8/13/2019 DOS Commands Notes
10/15
IT Workshop
Task 6. 4I"93 Commands
'. !s Command:
#: ? ls 45 it displas list of files directories
Output:
Desktop d'helper Music *ublic TemplatesDocuments e&les.desktop *ictures snist.c Yideos
? ls 4l 45 it displas list of files directories 'ith permissions 6r, ', & permissions7
. mkdir command:44 to create a ne' director
Synta( @mkdir Ldirector4name5
#:@mkdir mechb"
Output:
Desktop d'helper mechb" *ictures snist.c YideosDocuments e&les.desktop Music *ublic Templates
0. rmdir command:44 to remo9e a directorSnta&( @rmdir Ldirector4name5
%&( @rmdir mechb"
Output:
Desktop d'helper Music *ublic TemplatesDocuments e&les.desktop *ictures snist.c Yideos
1. cd command( 44 to change director
Snta&( @cd Ldirector4name5%&( @cd Mech3"
cdK 45 to go to root director
Snta&( @cdK
Mechanical B2 Page #=
8/13/2019 DOS Commands Notes
11/15
IT Workshop
5. rm command45 to remo9e a file
Snta&( @rm Lfile4name5
#( @rm snic.c
Output:Desktop d'helper Music *ublic TemplatesDocuments e&les.desktop *ictures snist.c Yideos
V. cp command45 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 YideoDocuments e&les.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 *ublic Templates
Documents e&les.desktop *ictures snist.c Yideos
;. cat command -/to create a file, displa a file, Zoin " files, Zoin " files and create a ne'
file and keep 'hole content in ne' file
(i). Synta( @cat5Lfile4name5 45 to create a file
#:@cat5 Mech3"
%nter the te&t and press L$trlX
8/13/2019 DOS Commands Notes
12/15
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
8/13/2019 DOS Commands Notes
13/15
IT Workshop
4inu 9ti!ities:
'. %anner command45 it makes postersSnta&( @banner Lte&t5%&( @banner 1IT
. ca! command45 it displas calendarSnta&( @calOutput:
\anuar "=##
Su Mo Tu Pe Th 0r Sa
#
" ; N V W :> #= ## #" #; # #N#V #W #: #> "= "# """; " "N "V "W ": ">;= ;#%&( @cal 45 it displas current month calendar%&( @cal "== 45 it displas all #" months of "==
0. date command45 it displas date timeSnta&( @dateTo displa current date
%&( snistBsnist4desktop(E? date
Output:
Ped \an #> #"(V(" S$T "=##
1. &>o command45 it prints the login name of the person on the sstemSnta&( @'ho
%&( snistBsnist4desktop(E? 'ho
Output:ra9i ttW "=##4=#4#> #"(;" 6(=7ra9i pts= "=##4=#4#> #"(;V 6(=.=7
5. tty command -/it displas the name of the terminalSnta&( @tt
Mechanical B2 Page #;
8/13/2019 DOS Commands Notes
14/15
IT Workshop
%&(snistBsnist4desktop(E? tt
Output:
de9pts=
6. uname command -/it displas name of the current inu& sstemSnta&( @uname%&(snistBsnist4desktop(E? uname
Output:
inu&
. #c>o command:Snta&( @echo Lte&t5%&( @echo S-ISTOutput:
S-IST
;. p&d command -/it prints 'orking directorSnta&( @p'd%&( snistBsnist4desktop(E? p'd
Output:
homera9i
8/13/2019 DOS Commands Notes
15/15
IT Workshop
Mechanical B2 Page #N