Windows Command Line lab 1.
Windows Command Line lab
1. Open the Command Line Interface (show final results in one screenshot):
1. Click the Start button.
2. For Windows Vista, 7, and 8, access the Run command by pressing the Windows logo key
+R.
3. In the window that opens, type cmd.
4. Select OK.
2. The help command:
1. Type help at the command prompt. Describe the results in your lab.
2. Use the help command to learn information about the following Key Commands:
help, dir, cd, cls, echo, del, md, rd (for instance, type help md to learn about the md command).
3. Record the function of the following Key Commands in your lab (i.e., “The time
command displays the current time and allows you to change it.”)
3. Apply Switches:
Add a switch to change a command's behavior. In Windows, a switch follows the format /letter (/A, /B, etc.).
1. Try the following switches with the dir command (dir /X). Record the function of each in your lab. Use the help command if you need help identifying what the switches do:
a) /B (type dir /B)
b) /L
c) /O
d) /O:G
e) /O:D
f) /S
4. Discover the cd Command:
1. Record your current directory in your lab.
2. Type help cd. What does cd stand for?
3. Are cd and chdir the same?
4. Type the commands listed below in one terminal window and show results:
a) cd C:\Windows\Web
b) cd \
c) cd Documents and Settings
d) dir
e) cd C:\Windows\Web
f) cd .. (type cd, a space, and two dots)
g) dir
h) cd ..
i) dir
5. Discover absolute and relative paths:
Type the following commands (not all will work). Describe the results after each command and discuss the difference between absolute and relative paths in your lab.
1. cd C:\WINDOWS\Web (note: this is an absolute path)
2. cd .. (note: this is a relative path)
3. cd .. (note: this is a relative path)
4. cd Windows (note: this is a relative path)
5. cd Web (note: this is a relative path)
6. cd C:\Documents and Settings (note: this is an absolute path)
7. cd Windows (note: this is a relative path - why doesn't this work?)
8. cd Web (note: this is a relative path - why doesn't this work?)
9. cd \ (note: this is an absolute path)
6. Create and Delete Files and Directories With the CLI:
1. Use the help command to review the functions of the echo, del, md, and rd commands.
2. Use cd to move to the desktop directory.
3. The echo command can create new files. Type echo hello > myFile.txt
What does this do? (Look inside (open) the file myFile.txt)
4. Delete myFile.txt.
5. Use the md command to create a new directory called MyDirectory.
6. Delete MyDirectory.
7. Explore the Relationship Between the CLI and the GUI:
1. Access the Command Line Interface.
2. Use cd to move to the desktop directory.
3. Create a directory and name it myDirectory. Look at the desktop Graphical User Interface. Note any changes in your lab.
4. Go back to the Command Line Interface and cd to myDirectory.
5. Create a file in the directory. Set the title to .txt. (If your last name is
Anderson, name the file Anderson.txt.)
6. View the desktop GUI (your desktop). Is the directory there? Is the file there? Delete the file with the GUI.
7. Return to the Command Line Interface. Does the directory still contain the file?
8. Referencing your observations from steps 1-7, discuss the difference between files, folders, and directories in your lab. You can use Google to help you with this question; however, make sure to cite the source(s) used and include a reference page.
8. Practice:
Run 5 commands of your choice that you have not used in this assignment. Provide screenshots.
9. Analysis Questions:
1. Are directories and folders the same thing? Why or why not?
2. Compare and contrast the Windows Graphical User Interface and Command Line Interface.
3. Open the Command Line Interface and move to the desktop directory. What happens if you execute (in order) the following commands? Describe the results of each command. If the command does not work, explain why.
a) echo shoe > frank.txt
b) rd frank.txt
c) del frank.txt
d) md frank.txt
e) del frank.txt
f) rd frank.txt
Comments
Post a Comment