Solutions to Lab 2 ------------------ 1. cut -c1-7,12- cscourses 2. wc outputs the number of lines, words, and characters respectively. 3. -c 4. a) touch \%jajaa\$ b) touch humpty\_dumpty c) touch thisisaverylongfilenameindeed\! d) touch midsummer\ night\'s\ dream 5. ln -s FavoriteProfessor 6. Try to "rm" on one of them. Do a "cat" on the other. If this works (i.e., you get some output), the "other" is the linked-to file. If it doesn't work, the "other" is the link. 7. By default, "ln -s a b" and "ln -s b a" create a cyclic set of symbolic links. Trying to 'cat' one of them says that UNIX is attempting to traverse too many levels of symbolic links and will abort. 8. UNIX will trap such an attempt on the command line and prevent such a cyclic traversal to be created. 9. "c" will be a physical copy, not a link. This can be verified by deleting "b" and noticing that you can still "cat c". 10. "c" in this case will be a symbolic link since "mv" simply renames "b" to "c". 11. "od" does an octal dump of the characters in the file. A decimal dump is one where the characters are numbered according to the decimal system (i.e., 0, 1, 2,..., 10, 11, 12, ...). An octal dump is where we use the octal number system, with characters only from 0 to 7. So, we go 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, etc. Recall that every position is now a power of eight, so that '10' in octal really means '1*8 + 0' or eight in decimal. In the "od -c" output the first column is simply counting characters in octal notation.