1. Using Unix
Total Page:16
File Type:pdf, Size:1020Kb
CS3214 Spring 2013 Exercise 1 Due: Wednesday, Jan 30, 2013. 11:59pm (no extensions). 1. Using Unix It is crucial that everybody become productive using a Unix command line, even if the computer you are using daily is a Windows machine. Please do the following exercises, then answer the questions below. • Make sure your personal machine has a ssh client and an X11 server installed. On Linux, 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. Find out what ssh -Y does. • Test that you can run X11 client applications, such as xterm, such that they execute on a machine that is part of our rlogin.cs.vt.edu cluster and use your computer as their display. 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 more 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 2013 Exercise 1 alias arch bc bzip2 cal cat cd cmp clear cp date df diff dmesg du echo env exit expr expand factor file find grep gzip head host hexdump history hostname id info jar kill killall less ln ls mail man mkdir more mv od passwd ping printf ps pwd quota reboot rm scp ssh stat sleep sort tail tac tee tar time type touch top uniq ulimit unzip unix2dos umask uptime users unalias uname vi/vim/view w wc whereis which whatis who whoami xterm xclock zip locate printenv enscript ps2pdf Answer the following questions: 1. To which file did you need to add your public key to set up public key authentica- tion? 2. Which shell key offers filename completion in your shell? 3. Which command do you use to find out the name of the machine on which your shell runs? 4. How many machines are part of the rlogin cluster (Hint: visit http://rlogin.cs.vt.edu/) 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 is the significance of filenames that start with a dot? 9. Why do many people define an alias for rm using alias rm=’rm -i’? 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. How much free space is left on the filesystem on which your home directory resides on the CS cluster? 2 CS3214 Spring 2013 Exercise 1 16. Which command line editor do you prefer? What to submit: Submit a plain ASCII file with your answers. 3.