CS3214 Spring 2011 Exercise 1

Due: Wednesday, Jan 26, 2011. 11:59pm (no extensions).

1. Using

It is crucial that everybody become productive using a Unix line, even if the computer you are using daily is a Windows machine. Please do the following exercises, then answer the questions below. • sure your personal machine has a ssh client and an X11 server installed. On , these programs are usually installed by default; Windows or Mac OSX users may have to install them. The Cygwin/X package for Windows provides both ssh clients and an X11 server. • Set your machine up for public key authentication when logging on to rlogin.cs.vt.edu. Use ssh-keygen to create a key. out what ssh -Y does. • that you can run X11 client applications, such as xterm, such that they exe- cute on a machine that is part of our rlogin.cs.vt.edu cluster and display on your computer. For instance, ‘xclock &’ should open a clock on your computer if set up correctly. • Make sure you can use the command line editing facilities of your shell. For bash users, which most of you are by default, examine the effect of the following keys when editing: ˆd, TAB,ˆa,ˆe,ˆr,ˆk,ˆw Examine the effect of the following keys when you invoke a program:ˆc,ˆs,ˆq (ˆx stands for Ctrl-x.) • Make sure you know how to use a command line editor, such as vim, nano, pico, or emacs. • Familiarize yourselves with the following Unix commands if you aren’t already fa- miliar with them. Hint: you can learn about most commands by either typing: “man < name >” or “info < name >”. It is not necessary that you know every option of these commands by heart.

1 CS3214 Spring 2011 Exercise 1

arch bc bzip2 clear date dmesg env expand factor file find gzip host hexdump history hostname id info jar killall less mail man more passwd ping quota reboot scp ssh stat tac tar top ulimit unzip unix2dos uptime users unalias /vim/view w whereis which whatis whoami xterm xclock zip a2ps locate printenv enscript ps2pdf 1. After you have set up public key authentication, run the commands xterm -e ssh -Y [email protected] and, separately, ssh -Y [email protected] xterm Explain the difference and describe which of the two commands one would ordi- narily prefer, and why! (This question assumes you have the programs ’xterm’ and ’ssh’ installed on your computer. If you don’t have those installed, answer the question by consulting their man pages.) The following questions relate to the machines on our rlogin cluster. 2. Password-less login requires that ˜/.ssh/authorized_keys on the remote ma- chine is not writable by anyone but the user to whom it belongs. Why? 3. Which shell key offers filename completion in your shell? 4. Which command do you use to find out the name of the machine on which your shell runs? 5. Which programs of the list given above are compression programs? 6. Which switch do you pass to tail to observe a file that is still being written? 7. When was the machine on which you’re doing this exercise last rebooted? 8. What switch do you need to pass to ls to show files that start with a dot? 9. Why do many people define an alias for rm using alias rm=’rm i’?

2 CS3214 Spring 2011 Exercise 1

10. Which command compares two files line by line? 11. Which switch makes grep recurse down directories? 12. What is the difference between the commands date and time? 13. Which key do you use to search for something when using the info program? 14. Which Unix group(s) are you a member of on our CS cluster? 15. Which switch do you prefer when running the df command? 16. Which switch do you prefer when running the du command? 17. Which command line editor do you prefer? What to submit: Submit a plain ASCII file with your answers.

3