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 2017
Section 4120 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/15)

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

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 2018)

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

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)
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/15).

Grades - Grades are current, to the best of my knowledge. Please call any anomalies to my attention tonight. There are 2 items (indicated) yet-to-be factored into your final grade average. They are the test tonight, and the DETER homework on "Comparative UNIX" due by 12/19 (see 11/17 posting below). (12/15)

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

"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/8)

Grades - updated, includes the fork/exec assignment. Grades are current, to the best of my knowledge. Please call any anomalies to my attention tonight. There are 2 items (indicated) yet-to-be factored into your final grade average. (12/8)

do the reading about the care and feeding of software in section 11 of the course outline.  (12/2)

Final exam date - Friday, December 15, in our classroom at class time. Please bring a scantron. (12/2)

Grades - Current, to the best of my knowledge.. Please call any anomalies to my attention tonight. There are 3 items (indicated) yet-to-be factored into your final grade average. (12/2)

do the "fork/exec/processes" exercise in the homework column of section 8 of the course outline, assigned verbally in class 10/31 - due on paper in class 12/2.
read - the material about "time" (setting clocks and scheduling jobs) in the reading column of section 9 of the course outline. (11/18)

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 19 (4 days after our course otherwise concludes with the final exam). (11/17)

No class meeting 11/24 - SMC observes Thanksgiving. (11/17)

No class meeting 11/10 - SMC observes Veterans' Day. (11/7)

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

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/3)

Grades - updated, link at left entitled "Grade information." Includes mock tech support assignment. (11/3)

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.  (10/27)

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


Internship opportunity. (10/26)

Career information event Nov 7. (10/26)

Relevant article I found today. It talks about exit status, and the use of commands' exit statuses as the basis for "if" branching. It also talks about using the "test" command and its variants to enable "if" to be responsive to numeric and string comparisons, like "if" in most other languages. (10/23)

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

Grades - updated, link at left entitled "Grade information." Includes mock tech support assignment. (10/20)

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

Way beyond our level - but worth your attention. The Advanced Bash-Scripting Guide is an extensive and unique collection (few hundred pages) of contributed, clever examples covering seemingly all the scripting features in the "language." Please be aware of it for the future occasions when you may want to find shell script examples of, just about everything. (10/13)

"if" versus "test" in shell scripting - don't get syntaxes confused. Which is the owner of the square brackets? 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/5)

Grades - posted, link at left entitled "Grade information" (10/5)

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/14 You are the support technician. Here is the request I received:


Grades - posted, link at left entitled "Grade information" (9/21)

Jet Propulsion Lab internship information. (9/20)

Homework - due on sputnik in your assignments folder by end-of-day Saturday 9/30
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 outline's first 5 sections.  (9/15)

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




Cassini space mission - symbolizes the enterprise of human science of which we are small parts, and ends today. I knew a couple people on Jet Propulsion Laboratory's Cassini team where I learned that rocket scientists are just people, applied people first then rocket scientists a consequential second. People like you. Anything's possible.


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/8)

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/8)

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

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/1)

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

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

Homework -
do Linux commands due on electronically on sputnik per the instructions by end-of-day Wednesday 9/20.
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/1)

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/1)

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

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

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

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/1)

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/1)

Procedures for using class laptops (9/1)

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

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/1)

Running linux at home. (9/1)


Eniac - 1946

Milestone in the history of computation



see course outline

In-class exercises

see course outline