In the name of Allah Islamic University of Gaza Faculty of Engineering Computer Engineering Department Introduction To Computer Lab Lab # 1 Disk Operating System El-masry 2013
Objective To be familiar with DOS. What is DOS? DOS stands for Disk Operating System. DOS is a non-graphical command line operating system introduced by Microsoft in 1981. DOS controls the computer s hardware and provides an environment for programs to run. Why DOS? There are a variety of reasons why you need DOS: 1. DOS allows you to store information on your computer. 2. DOS allows you to retrieve information stored on your computer in the case of Windows damage. 3. DOS interprets and translates the software you have on your computer. 4. DOS gives you access to all its function (i.e. saving, copying, and printing files). Disk Organization Files are stored in directories. A directory may contain no files, or it may contain many hundreds of files. A directory can also contain other directories, allowing you to build up a hierarchy of directories within one another in order to organize data. Directories and files are stored on drives e.g. C, D, ect. The file is described by its name and extension in file-name.file-extension form. In Windows, \ is used to separate file and directory names in the path of the file or directory that is used to go to that file or directory. For example, if the directory dir1 contains a directory dir2 which contains the file readme.txt, and the dir1 on drive C, the full path of readme.txt is C:\ dir1\drir2\readme.txt 2
DOS Command Prompt DOS commands are written on command prompt window. To access the command prompt from Windows, do as follows: 1- Start. 2- Type Run in the search box and click on the result program. 3- Type CMD. 4- Click OK. DOS Commands Drive-name: To change the drive For example, C: Go to the C drive. Similarly E: and D: etc. To change the directory CD\ Takes you to the top of the directory tree (e.g., to C:). CD.. Movesmoves you one level up the directory tree. CD <DIRECTORY-NAME> Takes you to that directory. CLS To clear the screen 3
To make a directory MD <dir-name> Creates a new directory below the current one. To remove a directory RD <dir-name> Removes a subdirectory of the current directory. The directory you want to remove must be empty of all files. To Display the contents of a directory DIR displays all files and folders in the current directory. Folders are indicated in the list by <DIR>. Files are usually listed by name and extension. The items with <DIR> are directories, or folders. Anything else is a file. The column on the left is the date the files were last changed, the next column shows the time the files were modified. The number to the left of the file name is the size of the file in bytes. 4
Notes:. that is in the first row stands for the current directory... that is in the second row stands for one level up the directory tree. DIR /P displays the contents a page at a time, i.e. as many as will fit in your command line window. Press any key to display the next page. DIR /W file. DIR *.ext displays the files/folders in multiple rows. This view gives less information per lists all the files with the ext extension in the current directory. To create a file EDIT <file-name.file-ext> if the file doesn t exist, it creates a new file called file-name.fileext in the current directory and opens it up for you to edit. If the file exists in the current directory, it opens the file to edit. To delete files DEL<file-name.file-ext> Delete the file from the current directory. DEL *.* Delete ALL files in the current directory. 5
DEL *. ext Deletes all the files with a specified extension. To Rename a file RENAME <OLDNAME.ext> <NEWNAME.ext> name including the extension. Renames a file. You must use the full file To copy a file COPY <file-name.file-ext><destination dir> copy the file that is in the current dir to the destination directory. If a file with the same name and extension exists in the destination, DOS ask you to confirm overwrite. To move a file MOVE <file-name.file-ext><destination dir> moves the file that is in the current dir to the destination directory. If a file with the same name and extension exists in the destination, DOS ask you to confirm overwrite. To format a drive FORMAT drive-name: Destroys all data on the selected drive. 6
Exercise Apply all the basics that you learned from the lab. 7