Your assignment, should you choose to accept it, is to answer the following questions about our UNIX system. The idea is to try out some errors and special cases. Do this with a sense of exploration. There is often more than one right answer. This tape will self-destruct in 5 seconds.
If, in the process of experimenting, blow up your system, you will have to reinstall. Probably you should not be root while doing this stuff
How many files in /usr/bin start with an 'a'?
How many files in /usr/bin have an 'a' anywhere in the name?
How many files in /usr/bin have an 'a' somewhere in the
filename, and a 'b' somewhere later?
Which file was modified most recently in /usr/bin?
What does the up-arrow and down-arrow key do when you type
them into a bash shell window?
What does 'cd ~' do?
What does 'cd /' do?
What does the command "!c" do when you try it? What
if you replace the 'c' with other letters?
Type control-R and then begin typing some command you've
already entered. What happens?
What does the 'history' command do?
Look at the file /etc/passwd. This is the password file
for the system. Is it world readable? Is it world
writeable?
Show me a command that prints the password file in alphabetic
order. Hint: Use a pipe and the sort command.
Show me a command that prints the alphabetically first entry
in the password file. Hint: Check out the head command.
Look around the /proc filesystem. How many megahertz is
your CPU?
Look around the /proc file system. How long has your
computer been up since the last reboot.
What happens when you edit a directory (i.e. nano /tmp )
or write to a directory directly (i.e. echo hello >
/tmp)? What if you're root?
How many processes are running on your system? The command ps
-augx will show all processes, and the first column of wc
will tell how many lines were on its standard input.
Ping some other computer that you know is working (i.e. ping
turing.nmu.edu). This generates network traffic once per second.
It also tells you how long the network round trip between the two
computers is. How long?
Try and ping yourself (i.e. if on euclid try ping
euclid.nmu.edu ). Is this quicker or slower than pinging some
other computer?
What is the longest filename you can use Try echo
hello > a_very_long_name until something breaks, and then
count the filename length.
Your shell is probably bash. Use ps and kill
-KILL to kill your shell. What happened? Hint: There might be
more than one bash running. If so, you might need to kill them all.
Make me a file that is exactly one million bytes long. You can either type for a long time or be trickey. One hint 'ftruncate'. Show it to me.
What command would print all the file names in /usr/bin in
REVERSE alphabetical order? (Hint: read the output of man
ls or use the 'ls' and 'sort' commands.)
Suppose you cd to the root directory (i.e. cd /)
and then cd up one more (i.e. cd ..). What happens? What
directory are you in?