Lab Activity 1: Basic for Unix/Linux Solved

12.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

5/5 - (3 votes)
Lab Activity 1: Basic for Unix/Linux

 

Objectives

 

  • Develop the skills to find, read, and understand sources of information about commands usage.
  • Identifying appropriate commands needed to perform given tasks

 

Submissions (2pts)

Once you’ve completed all the activities, perform the following steps for submission:

  1. Move the files lab1.1, 2, and lab1.3 into IFT383ss16/lab1 folder
  2. Change your working directory to be lab1
  3. Start capturing your session into file lab1
  4. Display the contents of file lab1.1
  5. Display the contents of file lab1.2
  6. Display the contents of file lab1.3
  7. Stop the session recording
  8. Submit the file lab1 thru Blackboard
  9. Submit the file script thru Blackboard

 

Part I Activities

 

It can be hard to remember all the commands and how to use them. The Unix operating system comes with a built-in manual (man pages) so that you can look up the details for how to use each command. Additional help facilities offered by Linux are the info command and the –help option.

This part of the lab is intended to give you practice using these commands. While it is possible to answer the below questions using Internet search engine, you are required to use only man pages, info command, and/or –help option.

For each question, you must give an answer as well as the source of your answer. For example, man page (or section) 2, info page, etc.

To answer the questions, follow the steps below:

  • Log into the lab computer with your asurite username and password
  • Change your working directory to IFT383ss16
  • Start capturing your session under filename script
  • Create the file 1 and type in your answers to the questions below. When this file is displayed with the cat command, the lines should be numbered, each number corresponding to the question number. (8 pts)

 

  1. Use the manual pages to explain the use of the following man options: man –h; man –k; man –a; and man –f
  2. The command passwd is documented in more than one man page or section. Find out those section numbers.
  3. The default output from the man command is the first manual page found. How do you force man to display all the manual pages for a particular command?
  4.  How do you ask man to display the entry from a particular section; for example displaying the entry from section 3p for the command mkdir?
  5. What should the command “cat lab1.1 – lab1.2” do?  (Don’t try to run it, just figure it out from the documentation.  Assume lab1.1 and lab1.2 are existing files.  Note the spaces and the dash in the command line.)
  6. What three options to the date command can be used to display the current date and time in Coordinated Universal Time?
  7. The command man usually contains far more information about a command than you need. The commands info, apropos, or –help could be more helpful. Which of these can give you a quick guide to printing the current month name (eg. January) using the date command?
  8. Which man page section provides documentation for the command  uname as used to obtain the “name and information about the current kernel” ?

 

  • Terminate your session recording

 

Now that you know how to get help, put it to use in Parts II & III below.

 

Part II Activities

 

Suppose you’re using your lab UNIX system to write a project summary report, “lab1.2.r” that must not exceed a specified number of words.

The approximate series of events that might take place is shown in the table below. For each step listed in the “Steps” column, you’re to provide the appropriate command in the “Commands” column. You must use only those commands covered so far.

To answer the questions, follow the steps below:

  • Log into the lab computer with your asurite username and password, if you’re logged off
  • Change your working directory to IFT383ss16, if you’re not there
  • Start capturing your session under filename script, appending to the previous recording
  • Create the file lab1.2 and type in your answers to the questions below. When this file is displayed with the cat command, the lines should be numbered, each number corresponding to the question number. Don’t just type the commands, make a complete sentence that includes the command surrounded by grave-accents. For example, if the first step says: “you write today’s date and time”. Your answer could be something like: “The current date and time is `date`(12 pts)

 

Steps Commands
1.     You write the date in the format “January 20 2015”  
2.     You displayed your current working directory  
3.     You go to your IFT383ss16 directory  
4.     You listed the directory contents to see the size of the file  
5.     You display the content of “lab1.2.r” file  
6.     You rename it as the first draft “lab1.2.r1”  
7.     You create a subdirectory called “lab1” to store the first draft  
8.     You move “lab1.2.r1” into the “lab1” subdirectory  
9.     You make a copy of “lab1.2.r1” and call it “lab1.2.r2”  
10.  After editing “lab1.2.r2”, you rename it as “lab1.2.r.final”  
11.  You remove the file “lab1.2.v1”  
12.  Finally, you count the words in “lab1.2.r.final”  

 

  • Terminate your session recording

Part III Activities

 

As a system administrator in your organization, you need to perform some urgent maintenance tasks. It would require shutting down the system, which could cause those still logged in to lose some of their work. Mindful, you go through the series of events listed in the table below. For each event in the “Events” column, provide appropriate commands in the “Commands” column. You must use only those commands covered so far.

 

To proceed, follow the steps below:

  • Log into the lab computer with your asurite username and password, if you’re logged off
  • Change your working directory to IFT383ss16, if you’re not there
  • Start capturing your session under filename script, appending to the previous recordings
  • Create the file lab1.3 and type in your answers to the series of events below. When this file is displayed with the cat command, the lines should be numbered, each number corresponding to the appropriate event. Don’t just type the commands, make a complete sentence that includes the command surrounded by grave-accents. For example, the first step says: “you decide to record all your actions under the file lab1.3”. Your answer could be something like: “All my actions are being recorded under lab1.3 file `script lab1.3`(8 pts)

 

Events Commands
1.     First of all, you decide to record all your actions under the file “lab1.3” just in case…  
2.     Next, you find out who is still using the system.  
3.     Since your closest neighbor (either right or left) is logged in, you sent him/her the following short message “Hi, please save your work and logout now, system maintenance”  
4.     You’re not having any response and decide to get more information about that user  
5.     Then you list all the active processes running on the machine  
6.     Finally, you kill the processes associated with his/her terminal. Indicate how you determine the ID  
7.     Now you stop capturing your session  

 

  • Terminate your session recording

 

  • Lab-1.zip