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
- Log into the system using your user id and password.
- Identify the system prompt. What is it?
- Determine your logon shell.
- 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.
- Use the man command to find out about the man command itself. Briefly write your findings.
(ALL answers should be 5 lines or less.)
- Use the man command to find out about the who command. Briefly write
your findings.
- Use the man command to find out about the whoami command. Briefly write your findings.
- Use the man command to find out about the date command. Briefly write
your findings.
- Use the man command to find out about the cal command. Briefly write your findings.
- Use the man command to find out about the passwd command. Briefly write your findings.
- You may log out, or continue with the following session.
Session B2
- Log into the system.
- 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.)
- Use the who command with the -q option.
(You may wish to look at the man page to see what this option does.)
- Use the who command with the -b option.
- Use the who command with the -s option.
- You may log out, or continue with the following session.
Session B3
- Log into the system.
-
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.
-
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.
- How many hours is your local time different from the universal time?
- Is your local time ahead of or behind the universal time?
-
Look at the descreption of man date and copy the description of
the format specifier: %B
-
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.
-
Look at the descreption of man date and copy the description of
the format specifier: %D
-
Use the command:
date +It is now: %D
-
Look at the descreption of man date and copy the description of
the format specifier: %F
-
Use the command:
date +It is now: %F
- Use date with the correct format control to print our time zone alphabetic abbreviation.
- Use date with the correct format control to print our current local 12 hour clock time.
- Use date with the format string +
%l %Z
- Use date with the correct format control to print our current 4 digit year.
-
Use date with a format string to produce output with formatted like:
Friday, 11 January 2012
-
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.
- You may log out, or continue with the following session.
Session B4
- Log into the system.
- Use the man command to find out about the cal command.
- Use a command to display the whole calendar for the current year. Do you need
to type a value for the year?
- Use a command to get the calendar of the current month.
- Use a command to get the calendar for the month of July in the year 2232.
- Use a command to find out which day of the week was the beginning of our
calendar (year 0001). What was it?
- Use a command to determine if the year 1900 was a leap year. (A leap year has 29
days in February instead of 28.)
- There is a "calendar" command in some UNIX systems. Is it on voyager?
- You may log out, or continue with the following session.
Session B5
- Log into the system.
- In some systems, there is a command called learn. Is it on voyager?
- 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?
- 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?
- 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
- Use the following command to create a file with your work from the assignment:
cat headingB sessionB1 sessionB2 sessionB3 sessionB4 sessionB5 > assignmentB.txt
-
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.
- Turn in your printout to the instructor on time.