Wednesday, October 23, 2019
Netw240 Week 2 Lab
NETW240 Week 2 Lab: Basic Linux Commands and Directories Lab Scenario Launching Your Lab The status of your lab is displayed at the top of the left navigation column. Click the Start Lab Now button. A progress bar displays while the lab is being initialized. During this time you can view items under the Content area of the left navigation bar. When initialization is complete, the status changes to In Progress. The clock starts and a lab diagram displays in the main content area. Click on the diagram that appears, and your virtual lab experience will begin.If your connection isn't working, verify connectivity by clicking Verify Connection in the Tools section on the left navigation bar. Assignment * Identify the difference between a casual user and the superuser (or root) by examining the shell prompt. * Illustrate the command used to switch from a casual user to the superuser. * Diagram, label, and describe the major system directories beneath root (/). * Illustrate the use of basic Linux shell commands to move around in the hierarchical file system. Diagram Lab Tasks See Chapter 3, The Linux File System.Note about text editors in Element K: All text editor tasks in this lab are shown using the nano text editor, but you are also free to use the vi text editor as an option if you know the more complex command hierarchy. If you are using nano as your text editor and Internet Explorer or Chrome as your browser, you cannot use Ctrl-O to save your file. This hot key is used by IE and Chrome to open files. You will have to exit and save as follows: Press Ctrl-X (Exit); at the prompt ââ¬Å"Save Modified Buffer,â⬠press Y then Enter. This will save the file and exit the text editor.Mozilla Firefox does not have this issue with Ctrl-O. | Step 1: Procedures If you are not already logged in, please log in as a standard user. Your login name will be student or vlab with the password password. 1. Click on Applications ; System Tools ; Terminal. This will bring up a Te rminal screen for you so you can apply the commands in this lab. 2. Using the ââ¬Å"switch userâ⬠(su) command, switch from standard user mode to the superuser (root) user mode. The root password is the same as the student password. 3. During the lab, you will be asked to enter answer to questions asked in your lab activities.You need to enter the answers to these labs at the bottom of this lab page and submit that to your course shell Dropbox in order to receive credit for it. Step 2: File System Navigation 1: Display a long listing of the filesystem root ( ? ). Enter ls ââ¬âl. Verify the output is in a long list format. 2: Display a long listing of the ? etc directory. Enter ls -l ? etc. Verify that the output is from the ? etc directory and is a long list. What type of files may you find in this directory? Write your answer in the answer sheet at the bottom of this lab. 3: Display a long listing of the ? in directory. Enter ls -l ? bin. Verify that the output is from th e ? bin directory and is a long list. What type of files may you find in this directory? Write your answer in the answer sheet at the bottom of this lab. 4: Display a long listing of the ? sbin directory. Enter ls -l ? sbin. Verify that the output is from the ? sbin directory and is a long list. What type of files may you find in this directory? Write your answer in the lab report document. 5: Display a long listing of the ? dev directory. Enter ls -l ? dev. Verify that the output is from the ? dev directory and is a long list.What type of files may you find in this directory? What is this directory used for? Write your answers in the lab report document. 6: Display a long listing of the ? usr directory. Enter ls -l ? usr. Verify that the output is from the ? usr directory and is a long list. What type of files may you find in this directory? Write your answer in the lab report document. 7: Display a long listing of the ? home directory. Enter ls -l ? home. Verify that the output is from the ? home directory and is a long list. What type of files may you find in this directory? Write your answer in the lab report document. : Display a long listing of the ? root directory and its hidden files. Enter ls -al ? root. Verify that the output is from the ? root directory and is a long list. What type of files may you find in this directory? What is this directory used for? Write your answers in the lab report document. 9: Return to your home directory. Enter cd ?. Enter pwd. What does the acronym pwd stand for? What is the output of the pwd command? Character ââ¬Å"? â⬠represents your home directory, regardless of who you are logged in as. What is a home directory used for? Write your answers in the lab report document. 0: Create files. Enter touch example1. Enter cp example1 example2. 11: Create a directory. Enter mkdir file-cabinet. Enter ls. You should see files example1 and example2 and a directory called file-cabinet. 12: Change directory. Enter cd file-c abinet. Enter ls. Enter pwd. What directory are you in? Write your answer in the lab report document. Enter cd â⬠¦ Enter pwd. Notice that the command cd .. took you back to the higher level directory. 13: Delete the directory. Enter ls. Enter rmdir file-cabinet. Enter ls. Was the directory file-cabinet deleted? Write your answer in the lab report document. 4: Delete the files. Enter ls. You should still be able to see both the example1 and example2 files. Enter rm example* (* represents zero or more characters). Enter ls. Were the example1 and example2 files deleted? Write your answer in the lab report document. 15: Get help on the ls command. Enter man ls | less. Now you can use your up and down arrow keys to scroll through the information on the ls command. You will notice that there are many options that can be used with this command. Remember that in order to use any of these commands you have to use a space between the command and the option.For example, ls -l works, but ls -l will not work. Result: N/A Step 3: Use the nano command line editor to create and modify files. Action: 1: Navigate to your home directory. Enter cd ~. Enter pwd. What directory are you in currently? Write your answer in the lab report document. 2: Use nano to create a file. Enter nano myfile1. You are now in Editor Mode for the file myfile1. 3: Add content to the file. At this point, you can type in some text. Type in your full name, address, and phone number on different lines. 4: Control Keys for nano. Note the control menu at the bottom of the nano text editor.The (^) symbol refers to the Ctrl key, so ^X (Exit) refers to simultaneously pressing the Ctrl and X keys. Other common control keys are ^K and ^U for cut and paste operations and ^R for opening a new file. ^W is a control key for finding text in a file. If you are using nano as your text editor and Internet Explorer or Chrome as your browser, you cannot use Ctrl-O to save your file. This hotkey is used by IE and Chrome to open files. You will have to exit and save as follows: press Ctrl-X (Exit) and at the prompt Save Modified Buffer, press Y then Enter.This will save the file and exit the text editor. Mozilla Firefox does not have this issue with Ctrl-O. 5: Save your modifications and exit. Press Ctrl-O and press Enter to save your myfile1 file. Press Ctrl-X to exit the nano command line text editor. 6: Check the content of your file. Enter cat myfile1. You now can see your contents of the myfile1 file. This concludes your lab. Download the lab report document for week 2. Please complete all questions on the answer page and submit the answers in the lab report template in the iLab section of the course shell.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.