You are on page 1of 5

Windows Command Line (Exercise 2)

Name : MUHAMMAD SYAFIQ BIN MOHD NAZRI

Student number : 2022891926

This exercise is a continuation of previous exercise. Make sure you don’t delete the directories that you
have created in exercise 1.

1st level Lesson


(top)

2nd notes tutorial


level

3rd Topic1 Topic2 Topic3 Lab


level

4th level <your name> Lab Work

1. Using Windows GUI, use Microsoft Word, Microsoft Excel and Notepad to create a few files in
the Lesson directory (In Lesson folder, right click and select [New], then select the type of files
as in the following screenshot):
2. Name the files as in the following screenshot:

3. Open the Windows command line interface program.

4. List all the files in your current working directory


Answer:

C:\Users\Muhammad Syafiq>dir

5. List all the files in your current working directory including hidden files
Answer:

C:\Users\Muhammad Syafiq>dir /a

6. Without going inside Lesson (from your current working directory), list the content of Lesson
directory
Answer:

C:\Users\Muhammad Syafiq>dir Lesson

7. Since your command line interface has become cluttered, clear the screen
Answer:

C:\Users\Muhammad Syafiq>cls

8. Go inside Lesson and list ONLY the Microsoft document files (.docx files) in that directory.
Answer:

C:\Users\Muhammad Syafiq\Lesson>dir *.docx


9. List ONLY the text files (.txt files) in that directory.
Answer:

C:\Users\Muhammad Syafiq\Lesson>dir *.txt

10. List ONLY the Microsoft Excel files (.xlsx files) in that directory.
Answer:

C:\Users\Muhammad Syafiq\Lesson>dir *.xlsx

11. Retrieve the command that you have used in step 8 for clearing the screen.
How do you access the previously used command?
Answer:

C:\Users\Muhammad Syafiq\Lesson>cls

12. List ALL files in that directory


Answer:

C:\Users\Muhammad Syafiq\Lesson>dir

13. Now open any text file (from the list)


Answer:

C:\Users\Muhammad Syafiq\Lesson>notepad catatan.txt

14. Open any Microsoft Word document


Answer:

C:\Users\Muhammad Syafiq\Lesson>start instruction.docx

15. Let’s say that you want to use color command. Give command so that the operating system will
provide more information on how to use that command.
Answer:

C:\Users\Muhammad Syafiq\Lesson>color zz

16. Change the background color of the command line interface (command prompt) to BLUE and
the foreground text to BRIGHT WHITE.
Answer:

C:\Users\Muhammad Syafiq\Lesson>color 1F

17. Restore the command line interface (command prompt) to the default color (use the
information in step 16).
Answer:
C:\Users\Muhammad Syafiq\Lesson>color

18. Go inside notes directory and remove Topic1.


Answer:

C:\Users\Muhammad Syafiq\Lesson\notes>rmdir Topic1

19. Go inside Topic2 directory and create 2 more directories. Name the directories as Data 1 and
Data 2.
Answer:

C:\Users\Muhammad Syafiq\Lesson\notes\Topic2>mkdir "Data 1", "Data 2"

20. Go back to notes (2nd level) and remove Topic2 directory (remove a directory together with its
content).
Answer:

C:\Users\Muhammad Syafiq\Lesson\notes>rmdir /s Topic2

21. Go back to Lesson (1st level)


Answer:

C:\Users\Muhammad Syafiq\Lesson\notes>cd..

22. Display latest directory structure together with all the files the following using tree command.

tree /f

23. Use [Snip & Sketch] tools to select the screenshot of your directory structure and its content.
(Refer the following image as the example)
24. Paste the screenshot on this document

Paste the sc reenshot here

Tips:

Keyboard Key Description


[Home] Jump to the beginning of a command.

[End] Jump to the end of a command.

[Ctrl] + Left/Right arrow Move the cursor by hoping to the left/right, one word at a time.

You might also like