Name_________________________________________________________________ 1. Log on to katie. 2. (10 points) Enter these commands at the UNIX prompt, and try to interpret the output. Ask questions and don't be afraid to experiment (as a normal user you cannot do much harm). Write down your interpretation of what happened after you execute each command in this document. When you are done, save this and submit it to Moodle - this is what you’ll turn in for grading. Hint One: if you start a command that you don’t want to continue executing, for example, changing your password again, d will usually stop the command. Hint Two: the command “man” is for manual. If you don’t understand what a command is doing, you can type, for example, man ls, and you will get the manual documentation for that command. echo hello world passwd date hostname arch uname -a dmesg | more (you may need to press q to quit) uptime who am i who id last finger w top (you may need to press q to quit) echo $SHELL echo {con,pre}{sent,fer}{s,ed} man "automatic door" man ls (you may need to press q to quit) man who (you may need to press q to quit) who can tell me why i got divorced lost clear cal 2000 cal 9 1752 (do you notice anything unusual?) bc -l (type quit or press Ctrl-d to quit) echo 5+4 | bc -l yes please (you may need to press Ctrl-c to quit) time sleep 5 history 3. (7 points) Try the following command sequence and write down what happened after each one: cd pwd ls -al cd . pwd (where did that get you?) cd .. pwd ls -al cd .. pwd ls -al cd .. pwd (what happens now) cd /etc ls -al | more cat passwd cd - pwd For the following questions, answer the question and also list the command(s) you used to get the answers. (1 point each) 4. Continue to explore the filesystem tree using cd, ls, pwd and cat. Look in /bin, /usr/bin, /sbin, /tmp and /boot. What do you see? 5. Explore /dev. Can you identify what devices are available? Which are character-oriented and which are block-oriented? Can you identify your tty (terminal) device (typing who am i might help); who is the owner of your tty (use ls -l)? )? (You may have to cd to the pts directory under /dev to see this.) 6. Explore /proc. Display the contents of the files interrupts, devices, cpuinfo, meminfo and uptime using cat. Can you see why we say /proc is a pseudo-filesystem which allows access to kernel data structures? 7. Change to the home directory of another user directly, using cd ~username. 8. Change back into your home directory. 9. Make subdirectories called work and play. 10. Delete the subdirectory called work. 11. Copy the file /etc/passwd into your home directory. 12. Move it into the subdirectory play. 13. What is the difference between listing the contents of directory play with ls -l and ls -L? 14. Create a file called “hello.txt” that contains the word “hello”. Do this with the command echo hello > hello.txt. 15. Copy hello.txt to terminal. What happens? Use who am i to find out your terminal number. Copy hello.txt to /dev/pts/. What happens? 16. How would you create and then delete a file that begins with the symbol -? Try it. 17. From your home directory, copy /etc/passwd and /etc/group into your home directory in one command given that you can only type /etc once. What command did you use? 18. Delete the play directory and its contents with one command. Accept no complaints or queries. What command did you use? 19. Change into a directory that does not belong to you and try to delete all the files (avoid /proc or /dev, just in case!) 20. Experiment with the options on the ls command. What do the d, i, R and F options do?