The Shell
- What shell are you currently using? What command did you use to
determine this?
bash, as shown using the ps command
- Use the following commands as arguments to the type command,
and write down where each of the commands reside.
argument location
man /usr/bin
uname /bin
tryme /$HOME/bin
echo shell builtin
type shell builtin
- Use the echo command to find the values of each of the following
shell variables. Write them down next to the variable name.
HOME /home/CIS190/your-home-directory
TERM xterm or linux
LOGNAME your login name
PS1 $PWD $
SHELL /bin/bash
PATH /usr/local/bin:/bin:/usr/bin:/home/CIS90/$LOGNAME/bin:.
- Set the TERM environment variable to "dumb", and execute the clear
command. What does it do? Set TERM back to "ansi" What happens?
dumb screen doesn't clear.
ansi screen clears, prompt goes to top of screen.
- What happens when you enter the following commands? Why?
DATE DATE: not found
Date Date: not found
date Unix is case sensitive
- What results do you get from the command: who -g
What program outputs this message?
the who commands outputs a usage message
- How many arguments do each of the following command lines have?
echo one two threefour three
echo "My TERM type is " $TERM two
echo one.two.three one
- What is the difference in output between the following two commands?
$ echo red 'white
> and blue' output takes up two lines
and
$ echo red white \
> and blue output is all on one line
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, displays the date and the current month's calendar.
$ clear; date; cal
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.__Forget it
2.__Give it to someone else
3.__Write it down in an easy-to-find location
- Using the uname command what options would you use to display
the operating system, it's version and release numbers?
$ uname -ovr
- What is the difference in output between the following two commands:
banner I am fine three lines of output
banner "I am fine" one line of output
- Use the finger command to find out what guest's plan is. Use guest90 as an argument to the finger command.
guest's plan:To pass this course with flying colors!
- What is your user id number? between 1100 and 1131
Using man
- Is tryme a Unix command? How do you know?
It's a command, but not a UNIX command.
- 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
They are the same.
- Use the manual pages for the who command to find out when the system was last
booted.
who -b
- 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?
It is equivalent to the command apropos. It searches for keywords
in the descriptions of all the commands.
- 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.
sqrt(361) returns the result: 19