Date: Thu, 17 Sep 1998 08:41:52 -0400 (EDT) From: chang@UUNET (Michael Chang) To: swgibson@UUNET (Stephen Gibson) The following is a list that corresponds pretty closely with man pages that need to be read. Don't consider it complete. Also, don't overestimate what you know already. If you know that tail prints out the last lines of a file, do you know what tail -f does? Have you ever actually bothered to read the man page for ls? Even if you've hacked around with Unix machines before, you might have never booted one over a network, or built a kernel, or written code to get two machines talking over the network (or maybe you haveā€¦) Even if you know everything about Unix (you often go bowling with Dennis Ritchie and drink beer with Ken Thompson), our setup isn't that vanilla so there's still a lot of localism to learn. Also, don't worry if you don't know any of this. You will be expected to learn how to do a few simple tasks almost immediately, but after that you will have a while before you get the root passwords and are expected to know how to use them. By that time we will have taught you a little and you will have taught yourself a lot of what you need to know. No one will stand over you with a whip, but if you put forth some effort then you could come out of this job knowing a hell of a lot. Okay, enough rambling. This is separated into categories that vaguely correspond to priorities. Dumping is your first priority. Some of these are things that you need to find out, and some are tips that are just easier to tell you. Dumping: - what is a filesystem? - what is ifs? What does 'df' do? What does 'file server' mean in our cad setup? - what are the options to dump? On a biweekly we do : dump Ousdf 32000 6250 /dev/rts8 / What does each of these mean? Tip: never memorize anything. - if you have a dump file, how can you get the table of contents? - what does shutdown, sync, amount, mount, fsck do? - what's the difference between reboot and fastboot? - what are the files /etc/motd, for? - when you see an executable, your first thought should be "Is this a binary or a shell script?" Use the 'file' command. - when a BSD machine is booted it runs the shell scripts /etc/rc, /etc/rc.local, and on some machines there is a /etc/rc.boot. What do these scripts do? What is a daemon? - for solaris 2.x machines, they use /etc/rc*.d and /etc/init.d startup scripts instead of /etc/rc and /etc/rc.local Miscellaneous Unix: - learn an editor. Type ls -alg 'cfin view vi ex'. These programs are all the same, they look at how they were invoked and behave accordingly. It's a good idea to learn both vi and emacs. I use emacs for general editing but use vi for editing system files as root. I also use 'ed' for quick editing of files on the consoles in the machine room or on the machines where /usr is not currently mounted. - what is the difference between the following: mv file1 file2 and cp file1 file2 rm file1 - 'cfin' will give you every occurrence of an executable on your path. - what does a .cshrc file do? When you log in, which gets read first, your .cshrc or your .login? Why do these files all start with a dot? - what dies a .rhosts file do? - what is a getty? What does the login program do? - what is a link? What's the difference between a hard link and a soft link? cd to /usr/spool on one of the workstation, then type 'pwd'. Why did this happen? Why is this necessary? - type 'ls -l'. What does all of this information mean? How do you use chmod (do you know octal?) The leftmost letter in the permissions is the file type, what is the difference between -,c,b,s,d,l, and the ones that I can't think of right now? - what does ps do? sys tat (you won't find this everywhere)? vmstat? iostat? netstat? the stats that I can't think of? - what's the difference between globbing and regular expressions? Which programs use which? - what does ruptime, ru, rwho do? - Do you have a real putty mouth? What does 'wheee, wheee, wheee' mean? - what does finger do? what is .plan, .project? How about finger @amanda? - what is news? What does 'rn' do? 'newsgroups'? What is your .newsrc? - learn awk. Once you know a little of this, uses for it seem to pop up almost every day (well alright, maybe once a week). Read the man page and look at the tutorial in one of the Berkeley books (the little books with the blue, white, red, or green binders and the little daemon on the front) or at the section in Kernighan & Pike. - learn how to use 'tar'. You should be able to make a tar file, extract one, and get a table of contents from one. What does this do: rsh amanda 'cd dir2; tar cf - .' |tar xvpf - - how come 'ls -lR *.c' doesn't recursively list files that end in .c? - how do you recursively list the files that end in .c? (how does 'find' work)? - learn how to use rsh, rcp. - read the man pages for 'hier' and 'filesystem' (these aren't commands, just man pages.) - what is a daemon? what does rwhod, fingerd, mdqsdaemon, named, rlogind do? whats special about inetd? Mail: - what does a .forward file do? What's in /var/spool/mail? What's in /var/spool/mqueue? What's /etc/aliases. - most staff worlders use mh. What does scan, inc, comp, forw, repl, rmm, next, prev, folder, refile, show, and pick do? How do you specify the editor to use for composing mail? What should be in your .mh_profile? - what does 'newaliases' do? - what does 'biff' do? how does it work? what's the comsat daemon? Programming and general software stuff: - learn c. - We have one source machine for each architecture (meaning this is the machine on which we keep the source code and do builds.) For the workstations, the source machine is the cad AVWI file server for that architecture (schwing for SunOS 4.1.3 sparcs, rasheeda for decs, ballast for sun3s, uranus for Solaris 2 sparcs). - We use rcs here. This is a Revision Control System that does things like prevent two people from editing the same source file at the same time, it keeps a history of every change you make in a file and allows you to retrieve an old version, and generally reduces the potential for chaos. Look at the man pages for rcs, co, ci, rcsdiff, rlog. Create a file, check it in, check it out, change it and do wacky things like that to get a feel for how it works. - what does fork do? - type man -k socket, what do these do? - whats the difference between a unix domain socket and an internet domain socket? Write two programs that can talk across the network. - what is a signal? - what is a pipe? Write a small program that spawns a child and communicates with it. - write a program that writes and reads a file. What's the difference between fopen and open? - what does rdist do? Make an rdist file to rdist your .cshrc and .login, for instance. - learn how makefiles work. Start making makefiles for the programs you write for practice. The general procedure for 'make'ing software goes something like this: make clean Cleans up the directory by deleting any old .o files and executables and core dumps and etc. make depend Looks at all the files and determines the interdependencies. make Does the actual compiling. make install Put's the resulting executable into the right directory with the right permissions, and installs the man page, etc. We have two versions of make here: make and pmake. Make is the standard unix make and is the one you should concentrate on. Look at any makefile that isn't under /usr/src/local. Pmake is a nifty Berkeley version of make that depends on using a bunch of include makefiles to allow for your makefiles to be tiny. Look at the makefiles under /fs/share/src/local. The make include files are in /usr/share/mk. If you see .include that means include the file from /usr/share/mk. Pmake is cool, but learn regular 'make' first. Shell stuff: - what is a shell? how does the system know which shell to start up when you log in? How do you change your default shell? - create an alias that uses command-line arguments. - read the man pages for sh (the Bourne shell) and csh (the C shell). Learn how to use 'if the else' and while and for loops and command line arguments and variables and whatever else comes to mind in shell scripts and on the command line. - what does it mean when the first line of a shell script is this: #!/bin/csh - what's the difference between 'this' and `this`. - how do you trap a control-c in a shell-script (for instance if you want to cleanup some temp files before quitting.) - can you do file completion in csh? - learn how to use csh's history mechanism. What does !-2 do? - what are environment variables, like $HOME and $EDITOR? How do you access these from a c program? Write one that does it. Learn how to set them from both sh and csh. Can you change these from a c program? How about a shellscript? Windowing: - how can you run an X command on one machine and have the window pop up on another? What does xhost do? What does xallow do? What is a MAGIC-COOKIE? - what does the 'secure keyboard' thing do? Why is it our friend? Random system stuff: - what are /etc/fstab, /etc/exports for? - what does exports do (on SunOs4.1 machines like the upgraded sun3's and the sparcstations.) - how do you create a mail alias? - how do you add someone to a group? - what is cron? You can experiment with cron by taking advantage of the fact that SunOs4.1 allows each user to create his own crontab file. Where is the system crontab file and what kind of things do we run every night? - what does 'su' do? what does 'user' do? - what does it mean for a program to be setuid or setgid? How come you can run 'chfinger' which, in effect, edits the password file but you can't just edit the password file with vi? Account stuff: - learn the format for the passed file - what does /etc/group do? - We have quotas on a few machines like tove and the junkfood machines. Find out how to check and edit someone's quota. Good books: (in my opinion.) You can find a copy of most of these laying around the office. owned by other staffers. 'The C Programming Language', Kernighan & Ritchie 'C, A Reference Manual', Harbison & Steele 'The Unix Programming Environment', Kernighan & Pike 'A User Guide to the Unix System', Thomas & Yates 'The Design and Implementation of the 4.3BSD Unix Operating System', Leffler, McKusick, Karels, & Quarterman 'Computer Architecture, a Quantative Approach', Hennessy & Patterson 'Internetworking with TCP/IP' Comer & Stevens 'Unix Network Programming' Stevens 'Advanced Programming in the Unix Environment' Stevens 'Programming Perl' Wall & Schwartz I'm open to suggestions for others.