Home About Courses Schedule Services Webinars Contact Search

Introduction to Linux & Shell Programming

SEE SCHEDULE

Duration: 5 Days

Method: Instructor led, Hands-on workshops

Price: $2750.00

Course Code: LI1003


Audience

Programmers, application developers, computer analysts, and other new or casual users of Linux systems who need to perform activities on Linux systems, or understand the use of the Linux system and the power of shell programming.

Description

This 5-day course provides a comprehensive introduction to Linux with focus on Bourne, Korn, and BASH shells. The presentation is an integrated mixture of lecture and workshop activities that introduce and reinforce the basic techniques and approaches to working with Linux commands, the shell, and shell programs. Workshop activities follow the classroom material and are designed for both topic reinforcement and practice. All programming topics are supported by workshops. This course is a combination of 3-day Linux and 3-day Shell Programming.

Objectives

Upon successful completion of this course, the student will be able to:

  • Organize and protect files and directories.
  • Create and modify files using the vi editor.
  • Display all or selected lines from files.
  • Use special Regular Expression characters to describe lines to be selected from files without specifying the exact characters to be found, such as "exactly 5 consecutive digits" to select lines with zip codes.
  • Direct the flow of data to and from the keyboard, screen, files, and executing processes by the use of redirection and pipes.
  • Control the execution of interactive "foreground" and batch "background" jobs.
  • Control multi-tasking.
  • Use special wildcard characters in filenames in order to type filenames more easily.
  • Tailor the Linux work environment by the use of aliases and environment variables, and by the use of the .profile file and in the Korn shell or BASH ENV file.
  • Create shell programs that use nested commands; variables, parameters entered on the command line; control structures including if, while loops, until loops, for loops, and case structures; read input from files, other commands, and interactive user input; write to files and other commands, and implement modular design by the use of subprograms.

Prerequisites

None

Topics

  • I. Introduction to Linux
    • Linux operating system
    • Login
    • Logoff via ^D or exit command
    • Display shell settings vua set -o
    • Ignoreeof to block ^D logoff signal
    • Shell command format
    • Interrupt character,
    • Linux concept of metacharacters
    • Backslash, single quotes, and double quotes
    • Timing considerations and shell interpretation of metacharacters
    • Commands date, who, ls, ls, stty, echo, banner, cal, man
  • II. Files and File Processing Commands
    • Characteristics of Linux files
    • Commands cp, mv, rm, cat, more, nl, head, tail
  • III. Command History
    • Turn command history on or off
    • Find, modify, and re-execute previous commandlines
  • IV. wc, sort, grep
    • Commands wc, sort, grep
    • Regular Expression
  • V. Regular Expression Metacharacters
    • Meaning and use of ., [ ], [^ ], ^, $, *, .*
    • Locate lines by using descriptions of content, not specific characters
  • VI. COMMAND I/0 AND REDIRECTION
    • Standard input, standard output, and standard error
    • Redirection of standard input and the tr command
    • Redirection of standard output
      • Overwriting
      • Appending
    • Redirection of standard error
    • Shell timing considerations with redirection
  • VII. PIPELINES
    • Pipes, pipelines, and filters
    • shell secondary prompt with pipelines
    • Commands cut, sort with the -u option
    • Techniques for efficient pipelines
  • VIII. FILE SYSTEM
    • File system characteristics
      • Three types of files
      • File system hierarchical organization
      • Structure and contents of directories
      • Directories . and ..
      • Absolute and partial pathnames
    • Commands cd, pwd, ls -l, mkdir, rmdir, rm -r
  • IX. ORGANIZE YOUR PART OF THE FILE SYSTEM
    • Commands mv, cp
    • HOME variable and changing directory
    • Move or copy files to the HOME directory
    • Assign the name of a directory the HOME variable
  • X. PROTECT YOUR FILES AND DIRECTORIES
    • Commands chmod, umask, ls -l, ls -d
    • Permission modes for files and directories
  • XI. FILENAME GENERATION
    • Filename generation wildcard characters
    • Using wildcards to avoid manually entering many filenames
    • Distinguish between Regular Expressions and filename wildcards
  • XII. CREATE AND MODIFY A FILE WITH THE vi VISUAL EDITOR
    • Commands of vi
      • Invoke vi with or without a filename
      • Write and quit
      • Use of ! with write and quit
      • Input
      • Delete
      • Line Numbering
      • Undo
      • Redo
      • Overwrite
      • Move text
      • Copy text
      • Scroll the screen
      • Move the cursor
      • Regular expressions in vi
  • XIII. vi SELF STUDY
    • After the course you can expand your repetoire of vi commands with over 50 additional commands that enable you to work faster with less effort
  • XIV. PROCESSES AND JOBS
    • Run commands in the background
    • Determine the status of background commands
    • Terminate background commands
    • Request the shell to wait for background commands to complete
    • Enter command that continue running after you logoff
    • Commands sleep, kill, ps, wait, nohup, jobs, fg, bg
  • XV. SHELL ENVIRONMENT
    • Shell variables HOME, PATH, LOGNAME, USER, PS1, PS2
    • Commands set, env, alias
    • $HOME/.profile
    • Korn shell and BASH ENV file
    • /etc/passwd
    • /etc/profile
    • Shell evaluation of command lines
    • set -x trace
    • PATH directories
    • Command names that contain /
  • XVI. SUBSHELLS
    • Semicolon to separate commands
    • Command grouping with parentheses
    • Special or built-in commands
    • Binary commands
    • Command groupings with ( )
    • Shell programs without the . command
    • Shell programs with the . command
    • export command and subshells
    • Commands logname, tty, id
  • XVII. SHELL PROGRAMS WITH POSITIONAL PARAMETERS
    • Two methods of invoking shell programs
    • Positional parameters
      • $1 through $9
      • ${10} through ${511}
      • $0
      • $*
      • $#
      • $$
    • Comments in shell programs
    • Debugging with execution trace
  • XVIII. COMMAND SUBSTITUTION ("Nested commands") AND QUOTING
    • Command substitution to create commandline words
    • Quoting mechanisms with variables and command substitution
    • Syntax for command substitution in Bourne, Korn and BASH shells
  • XIX. USER-DEFINED VARIABLES
    • Assign a value to a variable
    • Retrieve the value from a variable
    • Curly braces to delimit a variable name
    • Commands unset, expr, read
  • XX. if CONTROL STRUCTURE, EXIT CODES, $?, and test
    • if structure
    • exit command to terminate execution and set the exit code
    • $?
    • test command
    • Comparison operators
      • String
      • Numeric
      • Files and directories
      • And and Or
      • !
      • [ ]
    • Common styles of program organization with if
  • XXI. LOOP STRUCTURES: while, until, for
    • while
    • until
    • for
    • Commands shift, break, continue, true, false
    • Common styles of program organization with loops
  • XXII. case CONTROL STRUCTURE
    • Case structure
    • Wildcards specific to the case
    • Techniques for data validation