Dos
Dos
Dos
About DOS Refers to operating system software used in most computers that provides management of storage devices and the information on them. IBM-DOS or PC-DOS, MS-DOS
Command prompt
This is called the command prompt or DOS prompt. The flashing underscore next to the command prompt is called the cursor.
Basic DOS commands A. The Directories 1. To go back one subdirectory at a time: CD.. Ex. C:\ >dir1\subdir1\CD..
Basic DOS commands A. The Directories 3. To go to a subdirectory at a time: CD <subdir name> Ex. C:\ >CD Music
<rootdir name>:
Ex. C:\ >D:
Basic DOS commands A. The Directories 5. To list the files in a directory: DIR Ex. C:\ >DIR
6. To list the files in a directory with extended function: DIR/? Ex. C:\ >DIR/?
Ex.
C:\ >DIR/p
Basic DOS commands A. The Directories 7. To list the files in another directory: DIR D: Ex. C:\ >DIR D:
8. To list the files in another directory with subdirectory: DIR D:<subdir name> Ex. C:\ >DIR D:Pictures
Basic DOS commands A. The Directories 9. To create subdirectory: MD <subdir name> Ex. C:\ >MD John
Basic DOS commands C. Managing Files 1. To create a file: EDIT Ex. C:\ >EDIT
Basic DOS commands C. Managing Files 2. To rename a file or subdirectory: REN <oldname> <newname> Ex. C:\ >REN John.txt Joe.txt
Ex.
Basic DOS commands C. Managing Files 4. To copy a file: Ex. COPY <filename> D:
5. To copy files in a subdirectory: XCOPY <subdir> D: <subdir> Ex. Ex. Ex. C:\ >XCOPY Pictures D: C:\ >XCOPY Pictures D:Pictures C:\ >XCOPY Pictures D:Photos
Basic DOS commands D. Other commands C:\ >CLS C:\ >VER C:\ >VOL
(clear the screen) (displays version of OS) (displays disk volume label)
Special Characters
The ? represents any single character
C:\>COPY *.txt D:
The following are legal and illegal characters in a filename: Legal: A-Z 0-9 $#&@!()-{}'`_~ Illegal: |<>\^+=?/[]";,* and the space
Attrib
The attrib command is used to change the attributes of a single file or a directory.
Attrib +h (hide) Attrib h (unhide)
Example:
attrib +h filename (hide) attrib h filename (unhide)
Sample Activity
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. Go to the root directory D: (D:, CD\) Create a directory with your student ID number as the name of your directory (MD student number) Go to the directory you created (CD student number) Create a subdirectory IT111L (MD NIL) Create a file Student_List.txt (Edit) Go to IT111L Copy file Student_List.txt to subdirectory 1stSem Go to 1stSem (CD \student number\NIL\2ndSem) Create subdirectory Sked1 (MD Sked1) Create subdirectory Sked2 (MD Sked2) List all the files created in that subdirectory (DIR) Remove the subdirectory Sked1 (RD Sked1) Display tree directory (TREE) Close the command prompt (EXIT)
Go to the root directory D: (D:, CD\) Create a directory with your student ID number as the name of your directory (MD student number) Go to the directory you created (CD student number) Create a subdirectory IT111L (MD IT111L) Create a file Student_List.txt (Edit) Go to NIL (CD IT111L) Create a subdirectory 1stSem (MD 1stSem) Go to root directory (CD\) Copy file Student_List.txt to 1stSem (COPY Student_List.txt 1stSem) Go to 1stSem (CD\student number\IT111L\1stSem) Create subdirectory Sked1 (MD Sked1) Create subdirectory Sked2 (MD Sked2) List all the files created in that subdirectory (DIR) Remove the subdirectory Sked1 (RD Sked1) Display tree directory (TREE) Close the command prompt (EXIT)
Seatwork #1
Exer2
Exer2A Exer2A-1.txt Exer2A-2.txt Exer3 Exer3A Exer3B Exer3C Exer3C-1.txt Exer3C-2.txt