Updated: 2013-05-08 21:01 EDT

1 Readings, Assignments, Labs, and ToDoIndexup to index

 The Freedom to Choose

2 Final Exam – April 24 1:30pm in C144Indexup to index

4 From the Classroom Whiteboard/ChalkboardIndexup to index

5 Some CommandsIndexup to index

Keep a notebook with a List of Commands in it.

6 Some Review QuestionsIndexup to index

  1. Rewrite /home/me/../you/../../etc/../home/./me/../you/../me/./foo as a simplified absolute path.
  2. In an empty directory, how many words are in file b after this: echo x >a ; ls >b
  3. File a contains 3 lines. File b contains 4 lines. How many lines are in file d (not in c) after this command line: ln a d ; ln d c ; cat a a b b d d >c
  4. What is the final link count of file a after all the commands in the above question?
  5. What does password field :x: mean in /etc/passwd?
  6. If you are in /home/me and ls -l shows bar -> /foo then dereference bar as an absolute path with no symbolic links.
  7. If you are in /home/me and ls -l shows bar -> foo then dereference bar as an absolute path with no symbolic links.
  8. If you are in /home/me and ls -l shows bar -> dir/foo then dereference bar as an absolute path with no symbolic links.
  9. If you are in /home/me and ls -l shows bar -> ../foo then dereference bar as an absolute path with no symbolic links.
  10. If you are in /home/me and ls -l shows bar -> ../you/foo then dereference bar as an absolute path with no symbolic links.
  11. What command will show the type of file system inside a partition?
  12. What command will show the amount of free disk space in a partition?
  13. What command will recursively show disk usage in directories?
  14. Give a command line that will show lines containing the name root inside all four account files under /etc.
  15. Give a command line that will modify and move the home directory of account bob to be robert
  16. Give a command that will recursively find all pathnames (anywhere) owned by UID 1000.
  17. Give a command that shows all partition names and System IDs on the third disk.
  18. True or False: The System ID of a partition restricts what kind of file system you can put into it.
  19. Give the Linux and GRUB names of the third partition on the second disk.
  20. Give a command that will change permissions on a directory to make the names in it readable by group members, but prevent group access to anything in the directory. Do not change any other permissions.
  21. Name three types of partitions that you would find in a standard DOS partition table (e.g. as used by fdisk).
  22. What kernel option keyword do you add to boot a machine single-user?
  23. What GRUB line do you modify to add the above keyword?
  24. Which option to ls displays the directory itself and not its contents?
  25. What file records your default Run Level?
  26. What command displays your numeric UID and GID?
  27. How do you execute the program foo in the current directory?
  28. How do you display the value of the HOME environment variable?
  29. Comment out the splashimage line from your GRUB configuration file and reboot. What is different?
  30. How do you make your shell always search for commands in directory /usr/local/bin?
  31. Mount the file system in /dev/sdb2 onto /mnt/test and try this command (as root): ln /etc/passwd /mnt/test/foo – why does it fail? Hint: Links are made with inode numbers inside file systems. Different file systems have different sets of inode numbers. How could you make a different kind of link that would work?
  32. True or False: When going from Run Level 2 to Run Level 5, the system goes through Run Levels 3 and 4 first.
  33. When you use chkconfig to enable a service, the service is immediately started.
  34. True or False: The service command enables a service but does not immediately start it.
  35. Why is the sum of used plus available disk space usually about 5% smaller than the actual free space in a Linux ext file system?

7 Real Sysadmin WorkIndexup to index

You are now logging in to multiple machines. Set your shell PS1 prompt to include the machine name, so that you don’t type the wrong command on the wrong machine!

7.1 Reporting Bugs – A Case History in Four HoursIndexup to index

My course notes are written using the vim text editor in Plain Text Pandoc Markdown format and then processed automatically into HTML. I needed to know how to have Pandoc produce a formatted plain-text output file that wouldn’t lose any of the formatting information and could be re-input to Pandoc to re-generate itself exactly.

  1. 9:00am: I go to the Pandoc Markdown web site and search the documentation for a “pandoc” output format. I don’t find anything.

  2. 9:30am: I go to the Pandoc-Discuss online discussion forum to see if anyone has asked about a “pandoc” output format. I don’t find anything.

  3. 9:45am: I join the Pandoc-Discuss discussion forum, using my Google account.

  4. 9:48am: I post this question to the Pandoc-Discuss discussion forum.

  5. 11:17am: I get a reply suggesting a partial solution from a user Dirk.

  6. 11:31am: I explain why Dirk’s solution doesn’t work.

  7. 11:38am: I get a reply from John MacFarline, the author of Pandoc himself, giving me the correct solution. He updates his answer again at 11:43 with a further explanation.

  8. 11:45am: I try his solution and discover something odd. I produce a small example that shows the odd formatting.

  9. 12:12am: I post the odd example to the forum.

  10. 12:36am: A user Tillmann Rendel say that I’ve discovered a bug.

  11. 12:50am: Tillmann goes to the source code of Pandoc and locates the Perl code that causes the bug.

  12. 12:52am: Pandoc author John MacFarlane confirms the bug and fixes it. He “pushes” the new version of the Pandoc source code out to the web server so that everyone can update their own copy of Pandoc. I download and build the fixed Pandoc.

Let’s see you try doing that with a bug in Microsoft Word. :-)

| Ian! D. Allen  -  idallen@idallen.ca  -  Ottawa, Ontario, Canada
| Home Page: http://idallen.com/   Contact Improv: http://contactimprov.ca/
| College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/
| Defend digital freedom:  http://eff.org/  and have fun:  http://fools.ca/

Plain Text - plain text version of this page in Pandoc Markdown format

Campaign for non-browser-specific HTML   Valid XHTML 1.0 Transitional   Valid CSS!   Creative Commons by nc sa 3.0   Hacker Ideals Emblem   Author Ian! D. Allen