CS41 - Linux Workstation Administration
David Morgan
Santa Monica College
see syllabus for email address



Grade reports

Course outline

SMC dates/deadlines

DETER net testbed
  get/use an account
  news report (pbs)


Linux links

Remote Unix access with telnet

Remote Unix access with ssh

Variations among Unixes

vi - the Visual Editor

Line termination

Using ftp

Fundamental Unix Commands

System calls

File permissions

Filesystem analysis

Cheat sheet - bash shell

Shell script basics

Shell programming:
if and while

Shell programming book

Slide presentations


Bootup & Init


Nuts & bolts

More nuts, more bolts

vi editor


The Shell

Linux GUI

Shell Scripting


Homemade shell

Process miscellany




yum (auto-update)

ssh - Secure shell


Scheduled processes

Unix time

System control

Centralized logging

Kernel building



Molay chapter 1 (more)

Line termination



FALL 2016
Section 4118 6:30p - 9:35p Fri Bus 263

This Website (http://homepage.smc.edu/morgan_david) will be used extensively to communicate with you. Announcements, grade reports, and assignments will be posted here. The site can be viewed from an internet-connected browser anywhere. You are responsible for awareness of the information posted here.

Thank you - for your interest in the course and the subject. I enjoyed the class and hope it will serve you well. (12/16)

If you want to learn a lot of linux in a little time - I recommend the SCaLE 15x (Southern California Linux Expo) held Thursday - Sunday March 2-5, 2017. It's intense, inexpensive, local. (12/16)

Grades - updated at the link entitled "Grade reports" at left. Please call any anomalies to my attention tonight. (12/16)

Other courses I teach - are known to you from the main website front page. There, you can see the class-specific pages from recent semesters for a concrete idea of their exact content (particularly see the course outlines).

CS40 - Operating Systems (3hr credit, next offered Spring 2017)

CS70 - Network Fundamentals and Architecture (3hr credit, next offered Spring 2017)

CS75 - Network Protocols further depth and variety on the topic beyond CS70 (2hr credit, next offering unscheduled)

CS78 - Secure Server Installation & Administration (3hr credit, next offering unscheduled, seems likely perhaps summer 2017)
In this class, with cooperation from USC/ISI, we will have accounts on the DETER testbed where we will create remote test networks. 

I also teach related courses at UCLA Extension in linux system administration, linux networking, linux shell scripting, and cyber security. They are more costly than those of community college, but are public and available. (12/16).

Grades - please check them, so that if there are any problems or anomalies you can call them to my attention. (12/9)

Godspeed, John Glenn (12/9)

Final exam date - Friday, December 16, in our classroom at class time (12/9)

An "important" utility - the GNU hello program. (12/9)

"make" utility's logic in shellscript form - I came across it recently.

      makecmd() {
      # read the Makefile's rule, storing the target and dependency list separately
      # check each dependency for greater recency than the target
      # till you find one that's newer, if any
      # if you do, go through the list of commands executing each,
      # then truncate the dependency comparisions (to rebuild, you only need to do so once)
      read target colon sources      

      for src in $sources; do
        if [ $src -nt $target ]; then
                while read cmd; do
                        eval ${cmd#\t}

 from Learning the bash shell, Newham and Rosenblatt, O'reilly, p. 183 (12/9)

DETER homework - 
- this exercise on comparison among different flavors of UNIX. This is to be done on DETER, remotely, using the DETER accounts issued to you.
I've scheduled "reservations" for our class at DETER during the period from now through sometime shortly after our course ends. You can do it at your convenience any time during this interval.
additional instructions:
when to work - now through the end of the course
what to turn in - as the product of this assignment, answer the 7 multiple-choice questions at the end of the exercise write-up. Please submit answers to them onto the remote Unix machine using these preparation and submittal instructions. Please name your file "comparisons.txt".  - due in your assignments subdirectory on server Tuesday, December 20 (4 days after our course otherwise concludes with the final exam). (11/27)

Students I dropped - acar, chiao, chowdhury, flores, mack, raymond. Today is the deadline for dropping the class and receiving a W (withdrawal) on your transcript. Alternatively, you remain in the class and get a letter grade. These students are likely to receive an unfavorable grade, so that a W is probably preferable. If you do not want to be dropped it is reversible. Speak to me and I can give you a code that will enable you to "reinstate." (11/20)

Grades - published today at the link entitled "Grade reports" at left. Includes the 2 shell scripts and the test. Please check your grades and report any problems or anomalies. (11/20)

Jet Propulsion Lab opportunity - Information circulated to me yesterday: here, and here. (11/20)

No class November 11 - school closed for Veterans' Day (11/4)

Midterm test 11/18 - Will cover commands, permissions, shell and GUI. Please bring a scantron form 882. The test is closed book. (11/4)

DETER homework
- this exercise on comparison among different flavors of UNIX. This is to be done on DETER, remotely. More information will follow but you can examine the assignment now, early. (11/4)

do the reading and activities about the X Window System based gui in section 6 of the course outline.  
the reading about processes in section 8 of the course outline.  (11/4)

Next topics - will be the X Window System (gui) in course outline section 6, and processes, course outline section 8. (11/4)

Demonstration programs for unix process mechanism "fork/exec" - If you wish to examine or experiment, here is the series of 11 programs used in my slides demonstrating the workings of fork and exec. You can get them by sftp/scp from the home directory of sputnik.smc.edu's "public" account, password is CS78password. Find them under the same names by which they appear in the slides shown in class: fork1.c, fork2.c,..., fork11.c. If you download these source files and want to compile so you can run them, the command to compile would be, for example:

  gcc  fork1.c  -o  fork1

The summary of the point of these programs is:

Version Purpose
fork1 shows fork, demonstrates that 2 processes result
fork2 shows PIDs (process id numbers) of these processes, and that they're distinct
fork3 shows fork's return value to the child copy (zero) and its return value to the parent copy (child's PID)
fork4 shows how to code differentiated behavior via an "if" structure conditioned on fork's return value
fork5 incorporates an exec call in the child
fork6 introduces exit call in child and wait call in parent, to give orderly discipline to their relative timing
fork7 gets the name of the program to be exec'd from the user via the command line
fork8 interactively gets the name of the program to be exec'd by prompting user
fork9 puts the activity inside a loop to extend it to second, third, fourth,... commands
fork10 shows a zombie process
fork11 shows an adopted child, init process as its step-parent after being pre-deceased by its original parent


Homework - 
do the reading and homework in section 7 of the course outline, the 2 scripts due on sputnik end-of-day Sunday 10/30

Grades - posted at the link entitled "Grade reports" at left. (10/14)

Way beyond our level - but worth your attention. The Advanced Bash-Scripting Guide is an extensive collection (few hundred pages) of contributed, clever examples covering seemingly all the scripting features in the "language." (10/14)

"if" versus "test" in shell scripting - don't get syntaxes confused. The "condition" expression in an if statement is a command, and standard command syntax includes no such thing as surrounding square brackets for every command! 


Data dump program category - in class you will see me use xxd sometimes, to legibly display the bytes from some source in all their precise binary glory-- maybe a master boot record I obtained from the hard disk using the dd command, or a data stream snatched from the network interface card by Wireshark of tcpdump for example. Another such command is od. Here is some information about od and other data dump utilities. They can be useful. (10/7)

read - do the reading about the shell in section 5. Then do the reading about shell scripting in section 7. (We will come back to section 6, about graphical interfaces.)
do - I got a de facto request for tech support for our lab. Your homework is to compose an email response to it, explaining what went wrong and how to make it go right, and send the response to me via email. Please title the email "linux support" and I will use an email filter to capture incoming messages by that name. Please send it to my non-smc email address (see syllabus). Send it by end-of-day Saturday 10/15 You are the support technician. Here is the request I received:


- due on sputnik end of day Saturday 10/8
do - next assignment is at the link entitled "permissions" in the homework column of the course outline. The passwords for the accounts involved are all "password.UCLA$" and the server on which to remotely do the assignment is sputnik.smc.edu.
read - the "reading" material in Course outlines' first 5 sections.  (9/23)

Grades - posted at the link entitled "Grade reports" at left. (9/23)

Take-away from presentation on bootup, initialization, and service management:



Man page "section" categorization:

"Each man page should be categorized in a specific section, denoted by a single
character. The most common sections under Linux, and their human readable
names, are...:

1 User commands that may be started by everyone. 
2 System calls, that is, functions provided by the kernel. 
3 Subroutines, that is, library functions. 
4 Devices, that is, special files in the /dev directory. 
5 File format descriptions, e.g. /etc/passwd. 
6 Games, self-explanatory. 
7 Miscellaneous, e.g. macro packages, conventions. 
8 System administration tools that only root can execute. 
9 Another (Linux specific) place for kernel routine documentation."

from the "Linux Man Page Howto." Take a peek into /usr/share/man on Fedora, wherein all the man pages are actually stored. See also the Sobell textbook, pages 94-91, about the man command, the related info command, and the top sources for getting linux doc and information when you need it. (9/9)

Nuts and bolts - a few nuggets I find worth more than their weight
 - filename completion 
 - command recall with ctrl-r's incremental reverse search of history
 - "the root directory" versus "the directory root"
 - virtual terminals with ctrl-alt-Fn keystrokes  (9/9)

Accounts created for you on the remote server sputnik.smc.edu. See the link near the bottom entitled "Remote Unix system". (9/9)

Apple's launchd - the inspiration for systemd. You can see the strong parallels between this article's description of launchd and our discussion of systemd. (9/2)

FreeBSD startup - I logged in. Note the greeting I got.

This reflects operation of the SysV system initialization method in FreeBSD.  (9/2)

Homework -
do Linux commands due on electronically on sputnik per the instructions by end-of-day Wednesday 9/23.
read -
article Linux System Startup about Unix SysV startup procedure
article Inside the Linux Boot Process IBM
Sobell ch 5 "The Linux Utilities" - a catalog of important commands. Read it but skip discussion of the following less important commands: hostname, lpr, uniq, diff, mcopy, gzip/gunzip/bzip, apropos, finger, w, write/talk/mesg. Skip vim tutorial. While reading, I suggest you sit before a linux system and try out the commands and his examples hands-on. (9/2)

Flash memory fatigue factor. (9/5)

Course outline - with approximate weekly topic coverage corresponded to related readings, homework assignments, and in-class slides I will use. (9/2)

Sobell textbook author Mark Sobell has a website. (9/2)

Information sources about linux - see the latter several slides in the presentation at the link "Intro/installation" (9/2)

Replacing BIOS - including replacement for the MBR disk scheme. Necessitated to enable support of drives over 2TB. Dubbed "extensible firmware interface." (9/2)

Homework -
read -  from Sobell textbook-
Sobell ch 1 "Welcome" - read lightly, as casual background and overview
Sobell ch 2 "Installation Overview" - omit RAID and LVM sections. Omit sections on obtaining and burning source data on CDs.
Sobell ch 3 "Step-by-Step Installation" - read it over, up to section on X Window System; omit that and remainder of chapter. Describes installation steps.
view - this video of Marc Sobell, our textbook author, on a 1985 broadcast panel discussion about Unix. (9/2)

Bootable flash drives for you - containing a copy of linux similar to that on our classroom laptops, is available for copying to your USB drive. Optionally, if you are interested, bring an 8GB or bigger flash drive to class and we can copy onto it an image of the USB drive I have prepared. It seems to boot on several computers-- probably therefore yours. It's persistent. It contains the utilities and configuration I think useful for teaching. I have not road tested it on any scale but with you as my guinea pigs, it's an offer. It is not required, and I won't formally support things that may not work. No promises. But if you are interested come to class with a flash drive and I think you will leave with a linux environment in which to play. (9/2)

Procedures for using class laptops (9/2)

A Remote Unix system will be available for your use (acounts not yet created as of today).  (9/2)

Using ssh (secure shell). ssh is an important tool you will use for interacting with remote computers. For that you will need an ssh client. There are a number of ssh client alternatives. (9/2)

Running linux at home. (9/2)


Eniac - 1946

Milestone in the history of computation



see course outline

In-class exercises

see course outline