LAB 11 - Intro to CLI

.doc

School

Centennial College *

*We aren’t endorsed by this school

Course

101

Subject

Computer Science

Date

Dec 6, 2023

Type

doc

Pages

16

Uploaded by DeaconHippopotamus3887

Report
CNET-101 L A B 11 PC Hardware Introduction to Command Line Interface Student name: Student ID: Station ID: Objectives : After completing this lab, you will demonstrate the ability to: Use command-line functions and utilities to manage the operating system, including the proper syntax and switches. Use Notepad or Copy CON to create a file Move around a directory tree structure Parts needed: A computer with Windows 7, 10 or 11 Empty USB flash drive, or a USB flash drive with files that may be erased with no consequences. Ideally, it would be better to have at least 8 GB USB flash drive since these USB flash drives are more versatile than 4 GB or lower capacity USB flash drives. If you have more than one USB flash drive, one may be used as the working drive and the other to store any utilities or files you need. Notepad editor Notes: 1. For each step requiring a typed command the Enter key must be pressed to execute the DOS command. This instruction will not be given with each step. 2. For each command state your current directory and the full command. 3. Throughout this lab I will assume that the drive letter assigned to the USB flash drive will be E: If not, replace the correct drive letter wherever you see E: Convention: Boldface expressions indicate syntax that is entered literally as shown. Italic expressions indicate syntax for which you supply actual values. Vertical bar | indicates separate selections System administrators do not only use graphical user interface, or GUI, they use command-line interface as well since CLI is much more efficient and versatile. The steps to get to a command prompt are listed below for Windows 7, 10 or 11 operating systems. Click on Start | All Programs | Accessories | Command Prompt, or Click Start | type CMD in the Start Search box, and Enter Page 1 of 16
CNET-101 L A B 11 PC Hardware Introduction to Command Line Interface Student name: Student ID: Station ID: Windows 10/11 : In the Windows search box or Start button, type in CMD in the dialog box and click on or press Enter on Command Prompt. To pin the command prompt to the Taskbar or the Start Menu Click Start | Type CMD in the Start Search box | right-click CMD, and select Pin to Start Menu or Pin to the Task Bar. To run CMD as an Administrator Click Start | Type CMD in the Start Search box | right-click CMD, and click Run as an Administrator Using the Built-in doskey Program Doskey is built in to the command prompt and keeps history of all the commands you enter in the command prompt session. Using doskey you can retrieve previous commands so that you don’t have to type them again. The following table shows you the keys you can use to retrieve commands. Keyboard Key Description Up arrow Recall the previous command Down arrow Recalls the next command in the dos key if any Page up Recalls the oldest command in the current session Page down Recalls the most recent command in the current session You can use the following keys when editing a retrieved doskey command. Key or Key combination Description Left arrow Moves the cursor back on character at a time Right arrow Moves the cursor forward on character at a time CTRL + left arrow Moves the cursor back one word CTRL + right arrow Moves the cursor forward one word Home Moves the cursor to the beginning of the line End Moves the cursor to the end of the line Esc Clears the command from the display Cutting and Pasting to and from the Command Prompt The command prompt has two Edit Options, the Quick Edit Mode and the Insert Mode. You can choose to use none, one or both of the options. The Quick Edit Mode allows you to cut and paste from the command line, and the Insert Mode works just like the Insert key if the keyboard; it allows you to insert characters in the command line. Page 2 of 16
CNET-101 L A B 11 PC Hardware Introduction to Command Line Interface Student name: Student ID: Station ID: To access the Command Prompt properties: right-click on the Command Prompt title bar and select properties. You should see a figure similar to the one below. Figure 1 If Quick Edit Mode is enabled you can use the mouse to highlight text and press the Enter key to copy the highlighted text. To paste data, right-click in the command prompt window and the data is pasted. Note: CTRL+C and CTRL+V does not work. Getting Help with commands. Anytime you need some help with a particular command you can get help in two ways. 1. At the command prompt type help followed by the command in question 2. At the command prompt type the command followed by \? For example, if I needed help with the command DIR I can do it in the following ways: C:\> help dir C:\> dir /? Page 3 of 16
CNET-101 L A B 11 PC Hardware Introduction to Command Line Interface Student name: Student ID: Station ID: Boot into Windows 10 or 11. Using any of the methods described earlier, invoke the command prompt after Windows has loaded. 1. Does a prompt display? If not and you followed every step correctly, contact your professor. 2. What is the prompt displayed on the computer screen. Whatever is displayed is called the current directory. For example, if the prompt C:\Cencol> is displayed on the screen, C:\Cencol is the current directory. For every command you need to write down, make sure you include your current directory . 3. Changing from one drive to another . To change from one drive to another, all you do is type the drive letter followed by a colon (:). For example, to change from the C: drive to E: you would enter: C:\Documents and Settings\> E: and hit the Enter key. Insert your USB flash drive, use File Explorer and note the drive letter assigned to you USB flash drive. For the purposes of illustrating the examples in this lab document, let’s assume we use drive letter E: Change your current directory to the root directory of your USB flash drive. Enter the command you use to change to your USB flash drive in the space below: 4. Make Directory Use help and find out what is the use and syntax of the command MD (Make Directory). Execute the following command and explain what happened, assuming there is no pre-existing directory DIR1 or DIR2. E:\> MD DIR1\DIR2 Page 4 of 16
CNET-101 L A B 11 PC Hardware Introduction to Command Line Interface Student name: Student ID: Station ID: In the root directory of your USB flash drive, create a directory with your first name as the name of the directory. In the examples from this point and on, the directory name of “CNET101” is used but you need to use your own first name instead when you perform this lab. In this directory, create the necessary directories so that it will end up with the following directory tree, as shown in figure 2. Figure 2 5. Tree The command Tree displays the directories in a tree structure. If you need the command to display the files in addition to the directories, use the switch /f Type the command E:\> Tree Call your professor and show your directory tree. Professor’s initials: __________________ 6. Remove Directory The RD (Remove Directory) command is used to remove a directory. To remove a directory, the directory must be empty and you cannot remove a directory while your current directory is the directory you are trying to remove. Enter the following command: Page 5 of 16
CNET-101 L A B 11 PC Hardware Introduction to Command Line Interface Student name: Student ID: Station ID: E:\> RD Dir1 What is the response of your system? To remove DIR2, run the following command E:\> RD Dir1\Dir2 Remove Dir1. Enter the command you used in the space below. 7. Change Directory The Change Directory command CD command displays the name of the current directory when entered alone, or, changes your current directory to another when a path is given. Enter the command E:\> CD CNET101 What is your current directory? While in your new current directory type cd labs From the command prompt, type CD\ The prompt changes to E:\>. If a message appears stating invalid command or invalid directory, you made a typing error. If you suspect an error, verify the backslash is after CD with one blank space between them. The backslash starts from the left side and goes to the right (\). Other commands use a forward slash, which would be in the opposite direction (/). CD is the command for Change Directory, which tells the operating system to go to a different directory in the tree structure. The \ after the CD command tells the operating system to go to the root directory. An alternative way of typing this command is CD\. Notice the space between the CD command and the backslash. There are usually different ways to do every command from a prompt. Note that the CD\ command allows you to return to the root directory at any time. Execute the following command E:\> cd CNET101 \labs Now type E:\ CNET101\Labs> CD.. Page 6 of 16
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help