Creative Intelligence @ Your Service
Site Map
+1 214 234 9283 | Send Email

Sample Linux Course Outline

Base Concepts

A Brief History of Linux

  1. Proprietary Operating Systems
    1. Why operating systems were developed in the first place.
    2. Early standards focused on languages, not system software.
    3. Proprietary operating systems not an issue until minicomputers emerged.
    4. State of computing in 1975.
  2. Origins of Unix
    1. Major purpose.
    2. Design philosophy.
    3. Function and performance goals.
    4. BSD fuels the growth of Linux.
    5. State of computing in 1985.
  3. The POSIX® Standard
    1. Stands for Portable Operating System Interface.
    2. Currently managed by IEEE Portable Application Standards Committee (http://www.pasc.org).
    3. Various Subsets.
    4. The IEEE maintains a team of lawyers (!) who interpret POSIX. See http://www.pasc.org/interps for details.
  4. Development of Linux
    1. Richard Stallman, MIT, and the Xerox laser printer (1970).
    2. Free Software Foundation and HURD (1984).
    3. Linux Torvalds, Linux, and the "merger" (1990).
    4. Linux is a POSIX, not Unix, implementation.
    5. GNU General Public License (GPL) and the Lesser GPL (LGPL).

Internal Structures

  1. Processes
    1. Protected memory space.
    2. Environment variables.
    3. Parents and children.
    4. Super and user privileges.
    5. Kernel and user space.
    6. Daemons and shells.
  2. Threads
    1. Interaction of processes and the scheduler.
    2. Thread code is run independently by the scheduler.
    3. All threads share the same memory space as the host process.
    4. Differences in context switch time.
  3. File System
    1. Volumeless tree starting at root.
    2. Subdirectory structure.
    3. Inode types and storage.
    4. File permission system: user, group, world.
    5. Virtual File System.
  4. Device Drivers
    1. Parity between devices and files.
    2. Device driver directory.
    3. Driver is executable code that delivers data back to file system.
    4. Typically run in kernel space.

Command Shells

  1. The login Process
    1. User and password collection.
    2. Authentication and configuration.
    3. Launching of the command shell.
    4. Initial configuration script processing.
    5. Differences for GUI based systems (X Windows).
  2. Command Shell Primer
    1. Basic functions of a shell.
    2. Various types of shells.
    3. Odd shell is the C shell: its scripting language looks like C.
    4. The base shell sh is useful for batch jobs due to low overhead.
    5. We will focus on bash in this course.
  3. Special Characters
    1. Variable expansion: $
    2. Universal pattern match: *
    3. Literal interpretation of next character: \
    4. Command line ends here: ;
    5. Comment follows: #
  4. Environment Variable Primer
    1. Purpose.
    2. Difference between environment and shell variables.
    3. Displaying all environment variables: env | more
    4. Displaying a specific environment variable: $<variable name>
  5. Key Environment Variables
    1. HOME
    2. HOSTNAME
    3. DISPLAY
    4. MAIL
    5. PATH
    6. PWD
    7. SHELL
    8. TERM
    9. USER

Linux User Fundamentals

Command Line Processing

  1. Parsing a Command Line
    1. Shell matches paired characters: ' " `
    2. Performs symbol expansion.
    3. Breaks resulting command line into word tokens.
    4. One line processed at a time.
    5. Backslash used as continuation character: \
    6. Semicolon breaks multiple commands on same line: ;
    7. If no errors, first token loaded and all tokens passed as arguments.
    8. Exception to above are shell built-in commands.
  2. Symbol Expansion
    1. File name expansion: [<text>]*[<text>]
    2. Environment variable expansion: $<variable name>
    3. Shell command expansion: `<string>`
    4. Inhibit file name expansion: "<string>"
    5. Inhibit all expansion: '<string>'
    6. Class Exercise: Interpreting Shell Expansion.
  3. Command Formats
    1. By definition first token, $0, is file loaded (command being executed).
    2. By convention, subsequent tokens prepended by hyphen are options
    3. By convention, tokens not starting with a hyphen are parameters
    4. Commands don't see most special characters after symbol expansion.
    5. By convention, commands needing a target use the last argument.
  4. Keyboard Shortcuts
    1. File name and path completion with the TAB key.
    2. Command line recall with up and down cursor keys.
    3. Command line editing with left and right cursor keys, backspace, DEL.
  5. Running Foreground and Background Jobs
    1. Commands can be executed in the background by appending an & as the last token.
    2. Foreground jobs can be paused by typing CTRL-Z.
    3. List all jobs running: jobs
    4. Start a paused job in the background: bg %<job identifier>
    5. Bring a background or paused job to the foreground: fg %<job identifier>

Essential Shell Navigation

  1. Current Directory Concept
    1. Initially user is placed in home directory.
    2. Can use change directory command to move within tree. cd
    3. Subdirectories are separated via forward slashes: /
    4. A single period indicates current directory and two periods parent.
    5. Subdirectory paths are relative to current.
    6. The path must be specified for an executable ($0) not in the PATH.
    7. Programs we write must reference PWD for current directory.
  2. Listing Subdirectories: ls
    1. Long format: -l
    2. Single column: -1
    3. Turn off directory expansion: -d
    4. Turn off filtering and show all files: -a
  3. Directory and File Manipulation
    1. Creating a new subdirectory: mkdir
    2. Removing an existing subdirectory, if empty: rmdir
    3. Copying files: cp
    4. Renaming (moving) files: mv
    5. Removing files: rm
    6. Forced removal option: -f
    7. Recursive removal option: -r
  4. Reading and Setting File Permissions
    1. The permission bit structure.
    2. View permissions with ls -a
    3. Set permissions with the chmod command.
    4. Change owner with chown
    5. Change group with chgrp
  5. Linking Files
    1. Difference between a link and a file.
    2. Hard versus soft links.
    3. Advantages of and restrictions on hard links.
    4. Creating links: ln [-s] <destination> <alias>
  6. Pipes and Redirection
    1. By design, Linux commands use standard system files.
    2. These can be redirected to other files.
    3. Output of one command can be used as an input via a pipe: |
    4. Here is one example: env | more
    5. There is no limit to the number of allowed pipes except for system capacity.
    6. When using pipes or redirection, arrange commands to reduce data at each stage.

System Administration Primer

  1. On Line Documentation
    1. Need a clue where to start? apropos <keyword> | grep "(1)" | more
    2. Quick reference manual pages: man <command>
    3. More in-depth reference material: info <command>
  2. Viewing Configuration Information
    1. Who is logged into the system? users and who
    2. Which machine am I on? hostname
    3. What is my current user name? whoami
    4. What hardware and operating system am I running on? uname -a
    5. How is the file system mapped to disk hardware? df
    6. How much free memory does the system have? free
    7. What TCP/IP connections are active now? netstat -t
  3. Disk Management
    1. Mounting CDs and hard disks: mount -<options> <device> <path>
    2. File systems.
    3. Mounting devices at system boot: /etc/fstab
    4. Removing CDs: eject cdrom
    5. Verifying the file system (DANGEROUS): fsck -N
  4. X Windows
    1. X history and architecture.
    2. Configuring remote displays.
    3. Fixing installation or other configuration errors.
    4. Opening X apps at a fixed position and size: -geometery <x>x<y>[+<width>+<height>]
  5. Stuck Software
    1. Linux doesn't fail so much as take forever to figure there is a problem!
    2. System originally designed in days of 300 baud modems, so timeouts are long.
    3. All processes are assigned an identifier.
    4. Passing this identifier a signal stops the process.
    5. Finding the identifier.
    6. Stopping the process.
    7. What does kill actually do?
  6. IP Addresses
    1. Most computers use dyanamic IP addresses.
    2. Sometimes devices need a static IP address.
    3. The file /etc/sysconfig/network controls IP forwarding.

Linux Programming Basics

Configuration and File Management

  1. Packing and Unpacking Archives
    1. The .ZIP file format is used on PCs to "bundle" a directory tree.
    2. Linux uses a command line utiltity for (tape) archives: tar
    3. Building archives.
    4. tar archives and expands relatively at or below the specified path.
    5. Unpacking archives.
  2. Software Installation
    1. Obtain the appropriate archive via download or media.
    2. Create a directory.
    3. Unpack the archive with tar -xvf[z] <bundle>
    4. Look for and run an install script.
  3. Red Hat Package Manager (RPM)
    1. Use on Red Hat systems where software supplier provides .rpm file.
    2. Type rpm -i <filename> to launch an install GUI.
    3. RPM guides choosing installation options.
    4. RPM automatically checks dependencies and installs software.
  4. Version Control Systems
    1. Software products change over the development life cycle.
    2. In team development, person A may make a change that breaks person B's code.
    3. Version control systems help by adding a version path to the directory path.
    4. Typical systems for configuration control.
    5. We will discuss version control concepts, but not these systems, in class.

Shell Scripting

  1. What is a Shell Script?
    1. Automates typing at the command line.
    2. Ordinary text files can be given run permission (recall chmod).
    3. In such a case, shell will read lines of text and assume they are commands (recall stdin and redirection).
    4. Thus hundreds or even thousands of commands can be executed by typing one: the name of the script file.
  2. A Simple Shell Script
    # .bashrc
    # User specific aliases and functions
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    # Source global definitions
    if [ -f /etc/bashrc ] ; then . /etc/bashrc ; fi
  3. Command Line Parameters
    1. During scripting, special environment variables exist to collect command line parameters.
    2. Positional parameters: $0, $1, $2, ...
    3. All parameters: $*
    4. All parameters, but qutoed: $@
    5. Number of parameters: #
    6. Others can be found in the bash man page.
  4. The if Statement
    1. Format: if <test> ; then <actions> ; [ elif <test> then <actions> ; ] [ else <actions> ; ] fi
    2. Arguments for the test command.
    3. Note if and elif and else are separate.
  5. The for Statement
    1. Command format: for <variable> [ in <arguments> ] ; do <actions> ; done
    2. Arguments may be hard coded text, shell parameters, environment variables, or anything that resolves to a token.
    3. The in clause is optional and creates a variable expandable with dollar sign.
    4. The actions execute once for each argument supplied.
  6. The while Statement
    1. Format: while <test> do <actions> ; done
    2. Test is performed.
    3. If true, actions are executed.
    4. If false, break out of loop.
    5. Lather. Rinse. Repeat.

Build Management

  1. The make Command
    1. Used to automate building (compilation and linking) of software.
    2. By default uses a file named either Makefile or makefile.
    3. Inspects file for targets.
    4. Checks targets for dependencies.
    5. If a dependency is out of date, executes the associated build command.
    6. Can use files with other names via the -f option.
  2. Structure of a Makefile
    1. Environment Variables.
    2. Recursive and Static Assignment.
    3. Defining Targets.
  3. Defining Build Commands
    1. Build commands immediately follow line after the target and start with tab.
    2. Commands must be one logical line long.
    3. Within a build command, one can use special environment variables.
  4. Chaining Makefiles
    1. The make command honors an include directive.
    2. Files are processed in order listed.
    3. Normally make processes the first target encountered (unless a target is specified).
    4. This also works with include directives: each file is processed using the same target.
    5. Technique to maintain independent Makefiles at subsystem level that are run at system level.

A Periodic POSIX Primer

We have a separate tutorial on periodic thread scheduling using only the capabilities of the Linux operating system. We will end this course with an in-class programming exercise.

Left Brained Geeks +1 214 234 9283