Assignment B

General instructions for all assignments

Provide an answer for each item in each session.
Number each answer with the same number as the corresponding item in the session assignment.
When the answer to the item is a Unix command, show the command and the system's response, as in the first two lines of the response for item 3 in the example below.
When the system prints more than 5 lines, abbreviate the response to 5 lines (unless more lines are specifically requested), showing the most important parts.
Use vi to create a file for each session, for example:
Use vi to create a file named sessionB1 like the following text (show your login id, but do not show your password) (only the first few responses are shown here):

Session B1

1. user id: atkins
   password: **********
2. The prompt is: $
3. echo $SHELL
   /bin/bash
   This shows the shell is the bash shell (the Bourne Again shell)
4. OK
5. man man
   man name  formats and display the on-line manual pages.
   name is normally  the name of the manual page, 
   which is typically the name of a command, function, or file.
   In this item the name of the manual page is man.

[et cetera] . . .
   

Session B1

  1. Log into the system using your user id and password.
  2. Identify the system prompt. What is it?
  3. Determine your logon shell.
  4. In the following items, make sure you understand the terminology used in the man pages. If you have questions, ask the other students, the tutor, or the instructor.
  5. Use the man command to find out about the man command itself. Briefly write your findings. (ALL answers should be 5 lines or less.)
  6. Use the man command to find out about the who command. Briefly write your findings.
  7. Use the man command to find out about the whoami command. Briefly write your findings.
  8. Use the man command to find out about the date command. Briefly write your findings.
  9. Use the man command to find out about the cal command. Briefly write your findings.
  10. Use the man command to find out about the passwd command. Briefly write your findings.
  11. You may log out, or continue with the following session.

Session B2

  1. Log into the system.
  2. Use the who command to find out about the users logged into the system. Make sure you see yourself. (Show your entry and three others in your answer.)
  3. Use the who command with the -q option. (You may wish to look at the man page to see what this option does.)
  4. Use the who command with the -b option.
  5. Use the who command with the -s option.
  6. You may log out, or continue with the following session.

Session B3

  1. Log into the system.
  2. Use the date command with no options to find the time.
    Note: The system administrator usually sets the default date as the date and time for the time zone at your locale.
  3. Use the date command to find the universal time.
    Note: The universal time is the time in Greenwich England. It is the base time from which all other time zones are calculated.
  4. How many hours is your local time different from the universal time?
  5. Is your local time ahead of or behind the universal time?
  6. Look at the descreption of man date and copy the description of the format specifier: %B
  7. Use the command:
    date +It is now: %B
    Note: The plus sign is needed before a specifier string, to format the results from the date command.
  8. Look at the descreption of man date and copy the description of the format specifier: %D
  9. Use the command:
    date +It is now: %D
  10. Look at the descreption of man date and copy the description of the format specifier: %F
  11. Use the command:
    date +It is now: %F
  12. Use date with the correct format control to print our time zone alphabetic abbreviation.
  13. Use date with the correct format control to print our current local 12 hour clock time.
  14. Use date with the format string +%l %Z
  15. Use date with the correct format control to print our current 4 digit year.
  16. Use date with a format string to produce output with formatted like: Friday, 11 January 2012
  17. Use date with the correct format control to print the number of seconds since the beginning of 1970 (excluding leap seconds).
    Note: This is the way the time and date is kept by the system.
  18. You may log out, or continue with the following session.

Session B4

  1. Log into the system.
  2. Use the man command to find out about the cal command.
  3. Use a command to display the whole calendar for the current year. Do you need to type a value for the year?
  4. Use a command to get the calendar of the current month.
  5. Use a command to get the calendar for the month of July in the year 2232.
  6. Use a command to find out which day of the week was the beginning of our calendar (year 0001). What was it?
  7. Use a command to determine if the year 1900 was a leap year. (A leap year has 29 days in February instead of 28.)
  8. There is a "calendar" command in some UNIX systems. Is it on voyager?
  9. You may log out, or continue with the following session.

Session B5

  1. Log into the system.
  2. In some systems, there is a command called learn. Is it on voyager?
  3. In some systems, there is a command called help. Use man to determine the syntax of the help command (if available). Experiment with this command. Do you find it useful?
  4. In some systems, there is a command called finger. Use man to find out about the syntax of the finger command (if available). Experiment with this command. Do you find it useful?
  5. Log out of the system.

Submission session

Create a heading similar to the heading for assignment A.

Tommy Atkins   replace with your name
CIS 18A    
Winter 2011   replace with the current quarter
Assignment B  replace with the current assignment letter

  1. Use the following command to create a file with your work from the assignment:
    cat headingB sessionB1 sessionB2 sessionB3 sessionB4 sessionB5 > assignmentB.txt
  2. Use e-mail or WinSCP to obtain a copy of assignmentA.txt. Print it using notepad, or otherwise use the Courier New or other mono-space font.
  3. Turn in your printout to the instructor on time.