Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

EE171 TUTORIAL ONE (SOLUTION)

INTRODUCTION TO MS-DOS
Open the MS-DOS command prompt and perform the following tasks
1. Write a command to display the contents of the current (home) directory.
To display the contents of the current directory we use command: dir

2. Write a command to clear the screen


To clear screen we use command: cls

3. In your current (home directory), create another directory named UDSM. Confirm if the
new directory has been created.
To create a directory we use a command: md UDSM

To confirm if the new directory has been created, we use command: dir
4. Move from your current directory to the newly created directory (UDSM)
To move from current directory to UDSM: cd UDSM

5. Write a command to create a text file named coet, then put some words in it.
To create a text file we can use echo command: echo >coet.txt

To put some words we use almost same command: echo safari ndefu >coet.txt

To confirm if the new text file has been created, we use command: dir

6. Display the contents of the file created above.


To display contents of a file we use command type: type coet.txt

7. Write a command to rename the file above from coet.txt to udasa.txt


To rename a file we use command ren: ren coet.txt udasa.txt

To confirm our task, we check again the contents of our directory (using dir):
8. Copy the file created (udasa.txt) from UDSM directory to home directory.
To copy a file we use command copy: copy udasa.txt c:\users\kasinge

9. Write a command to delete a file udasa.txt permanently from UDSM directory.


We use del command: del udasa.txt

10. Remove the directory UDSM permanently from the system.

11. Move from current disk drive C to another drive (example: drive D)

12. While in your current disk drive C, view the directories and files of another drive (e.g.
drive D)

13. In your home directory, display all directories and files starting with letter d.
14. In your home directory, display all directories and files ending with letters ts.

You might also like