Objectives
The purpose of this lab is to explore command usage with the shell
and miscellaneous UNIX commands.
Forum
If you get stuck, have a question or want to share something you learned with this lab then use the CIS 90 Forum at
http://simms-teach.com/forum/viewforum.php?f=9
Procedure
You must log on to the Opus server using your personal account acquired from
turning in lab01. The following questions pertain collectively to the
following unix commands:
banner bash bc cal clear date echo exit finger
history id man passwd ps type uname whatis who
Print out a copy of this lab and use it to record the answers to the questions
in the lab. You don't need to record the output of the commands.
The Shell
- What shell are you currently using? What command did you use to
determine this?
- Use the following commands as arguments to the type command,
to find out where each of the commands resides.
cmd argument
type man
type uname
type tryme
type echo
type type
- Use the echo command to find the values of each of the following
shell variables.
echo $HOME
echo $TERM
echo $LOGNAME
echo $PS1
echo $SHELL
echo $PATH
- Set the TERM environment variable to "dumb", and execute the clear
command. What does it do? Set TERM back to "vt100" or "ansi" What happens?
dumb
ansi
- What happens when you enter the following commands? Why?
DATE
Date
date
- What results do you get from the command: who -g
What program outputs this message?
- How many arguments do each of the following command lines have?
echo one two threefour
echo "My TERM type is " $TERM
echo one.two.three
- What is the difference in output between the following two commands?
$ echo red 'white
> and blue'
and
$ echo red white \
> and blue
Note: the [enter] key is pressed immediately after the last character
of each line.
- Use the shell metacharacter ";" to write out a one line command that
will clear the screen, print out the date and the current month's calendar.
$ ________________________________________
Commands
- If you have not already done so, use the passwd command to
change your password. Name three things you should never do with your
password:
1.____________________
2.____________________
3.____________________
- Using the uname command what options would you use to display just
the operating system, it's release numbers and the machine's network node name?
- What is the difference in output between the following two commands:
banner I am fine
banner "I am fine"
- Use the finger command to find out what guest90's plan is.
(Use guest90 as an argument to the finger command.)
guest90's plan:
- What is your user id number?
Using online documentation
- Issue a man bc command. Use q to quit.
- What is the whatis command?
Use the command with the argument, bc
How does this compare to using the man command with -f option?
man -f bc
- Is tryme a UNIX command? How do you know?
- Use the manual pages and the who command
to find out the number of users logged on.
- Run the command: man -k boot
Use the manual pages to find out what the -k option does.
What command is man -k equivalent to?
Run the equivalent command and verify.
- Run the command: info bash
See if you can explore the hot links (marked with a *). Use the up and down arrows to select
a link. Use Enter key to follow a link. Use L to go back to last page. Use Q to quit.
- Now use your PC browser (outside of Opus) and google "linux bc command". If you find any interesting sites you can post them to the forum.
- Here's a challenging task: Use the man command to discover how you can use the bc command
to obtain the square root of 361. The bc command is an example of an interactive
command, because you must enter the numbers to calculate from the keyboard while the program is
running.
Now that you have finished this lab, you may submit your work using
the following two commands:
history -a
submit
When the command asks you which assignment to submit, respond with 2 followed by the
enter key. Then answer the three questions that it asks of you.