Duration:
5 Days
Audience:
Employees of federal, state and local governments; and businesses working with the government.
Course Description:
Hands-on labs are run in a real-world UNIX environment, structured to allow you to learn by doing and developed to simulate real-world situations. You will build your UNIX knowledge and command skills in a clear and concise manner.
Working in a controlled UNIX classroom environment with an expert instructor, you will learn UNIX concepts and commands, and you will receive professional tips and techniques that will help you build your UNIX skills and confidence.
What You’ll Learn
- Prevalence of UNIX
- Various commands in the UNIX shell
- Manipulating and editing files
- Shell scripts
- File system tools
- Regular expressions
- UNIX filters
- Process commands: ps, pstree, pgrep, kill, and pkill
Who Needs to Attend
- Professionals who use UNIX-based systems and applications
Prerequisites
There are no prerequisites for this course.
Course Outline
1. Relevant UNIX History
- Evolution of Modern UNIX
- MULTIX
- UNIX Toolbox
- SVR4 and BSD
- Commercial UNIXes
- Four Major Influences
- Appearance of Linux
- MINUX
- Gnu
- Original Purpose of Linux
- What is Linux?
- What is the Kernel?
- What are the Major Designs? (SVR4, BSP, MACH, Linux)
- What is the Distribution?
- What are KDE and GNOME?
- Why so Many Distributions?
- Gnu Public License (GPL)
- Commercial Distributions
- Hidden UNIX/Linux
- Apple’s Commitment to UNIX
- IBM’s, Microsoft’s, and Oracle’s Commitments to LINUX
- CIFS, SAMBA, and NAS
- Routers, Switches, and Others
- Consumer Electronics
- Lookalikes
- CYGWIN
2. UNIX Interfaces
- Fundamental Concepts
- Fair and Secure Resource Sharing
- The Kernel
- Root
- Users
- Resources
- Memory
- CPU
- Files
- The Shell
- Provides Command-Line User Interface
- Interprets Commands
- Provides Programming Language
- Varieties of Shells: sh,ksh;bash;csh,tsh;zsh
- Graphical User Interface (GUI)
- x Windows
- CDE
- Using the Shell
- The 1s Command
- The 1s Command with Options
- The 1s Command with Arguments
- Using the 1s Command to Demonstrate Command-Line Syntax
- Using the 1s Command to Demonstrate Variation in UNIX
- The id Command
- The top Command
- The pseudo Command
- Changing Run Level to GUI Mode
- The 1s Command
- Using the GUI
- Finding the Text Editor
- Finding the Command Shell
3. Getting Help
- Customizing Google
- Choosing the Paginator
- Navigation
- Searching
- Manual Pages
- Man Page Sections
- The man Command
- Keyword Search
- Dissecting a Man Page
- Linux info Command
4. UNIX File Structure
- Hierarchical Directory Structure
- One Root Directory, Hard Drives Hidden from Users
- Rules for Naming Files
- Names Completely Independent of File Content or Usage
- Exception: Hidden Files
- No Limits on Path Depth or Length
- Types of Files
- Plain File
- Directories
- Symbolic Links
- Block Devices
- Character Devices
- Name Pipes
- Sockets
- Simple View of Files and Directories
- Telling the Difference, 1s
- Where Am I: pwd
- Moving Around: cd
- Viewing Files: cat
- When Am I: date
5. More Detailed Look at File and Directory Structure
- Directories
- Common UNIX Directories and Their Uses
- /tmp
- /usr/bin
- /usr/lib
- /proc
- /etc
- /var
- Your HOME Directory
- Your PATH
- The Difference between Relative and Absolute Pathnames
- Special Directory Names
- “.”
- “..”
- “~”
- “-“
- File Details
- The file Command
- The od Command
- Revisiting the 1s and cd Commands
- Determining File Attributes with 1s -1
- Using the cd Command with Relative and Absolute Pathnames
6. File Attributes Part 1: File Creation, File Ownership, and Links
- The touch Command
- Creating Files
- Modifying Timestamps
- Inodes
- File Ownership
- User and Group Ownership
- Password, Group, and Shadow Files
- The chon and change group Commands
- Hard and Soft Links
- Inodes and Data Blocks
- The 1n Command
- Practical Uses
7. File Attributes Part 2: File Permissions
- File Permissions Types
- Mandatory Access Control (MAC)
- Discretionary Access Control (DAC)
- Access Control Lists (ACL)
- Standard File Permissions (DAC)
- Read, Write, Execute
- Permissions on a File
- Permissions on a Directory
- The chmod Command
- Symbolic Mode
- Numeric Mode
- Default Permissions and the umask Command
8. Manipulating Files
- Copying Files
- Moving Files
- Removing Files
- Archiving Files with tar
- Compressing Files with gzip
9. Editing Files
- Survey of Available Editors
- pico
- vi
- vim
- gedit
- emacs
- xemacs
- vim
- Ten Commands to be Functional
- Seventeen Commands to be Advanced
- Looking like an Expert
- The .exrc and .vimrc Files
- Basics of gedit
10. Processes
- Basic Definitions
- Processes
- Threads
- Linux: UNIX Differences
- Kernel Threads
- Daemons
- Child Processes
- The ps Command
- Viewing Your Processes
- Viewing All Processes
- Viewing a Given User’s Processes
- The pstree Command
- The pgrep Command
11. Revisiting the Shell
- Wildcards also known as Globbing
- [],*,?,[!]
- Use with Commands
- Hidden File Exceptions
- Shell Variables
- Displaying
- Setting
- Exporting
- Using in Commands
- Using to Change Default Behavior
- Quoting Special Characters
- Command-Line Shortcuts
- File Completion
- Command Completion
- Command History
- Repeating Commands
12. Login and Logout Files
- Different Shells, Different Files
- What the System Administrator Sets for You
- Modifying Your Profile
- Setting Your Umask
- Setting Your Path
- Setting Your Own Variables
- Aliases
- Setting Options, such as noclobber
- Defining Functions
- Sourcing Your Profile
- The “.forward” File
13. Scripting: Your First Shell Script
- Basic Commands
- The shbang Line
- Comments
- White Space
- The echo Command
- The read Command
- Advanced Concepts
- Command-Line Substitution
- logname
- Changing Permissions
- Pathing Options and How to Run Your Shell Script
14. Standard In, Standard Out, and Standard Error
- Redirecting Standard Out and Standard Error
- Redirecting Both Standard Output and Standard Error to Same Place
- Throwing Away Unwanted Output with /dev/null
- Appending as Opposed to clobbering
- Preventing File Destruction with noclobber
- Piping
- Piping to Standard In
- Multiple Pipes
- The tee Command
- Advanced Piping Features
- Piping Standard Error
- Xargs
- Real-World Example, Part 1
- Write a Silent Ping
15. Scripting: Conditional Execution
- Exit Status
- Zero Success
- Displaying Exit Status
- Four Ways to Test
- “||” and “&&”
- The “test” Command
- “[ ]”
- “[[ ]]”
- What to Test On
- File Test
- Permission Test
- Numeric Test
- String Comparisons
- Test Number of Arguments Given a Script
- Structured if Statement
- if,then,fi
- elif,then
- Real-World Example, Part 2
- Using ping to Determine if a Machine is on the Network
16. Scripting: Looping
- A for Loop
- Looping over a Set Number of Items
- Looping over an Unknown Number of Items
- Looping over all the Arguments in a Script
- A while Loop
- Looping over all the Arguments in a Script
- Looping over a Numeric Range
- Infinite Loops
- Until Loops
- The seq Command
- Abnormal Loop Termination
- Continue
- Break
- Real-World Example, Part 3
- Loop Pinging all Addresses in a Subnet
17. File System Tools
- Find: Finding Files Based on Their Attributes
- Basic Syntax
- Using Name and Globbing
- Remembering Quoting
- Using Type, Time, Size
- Using find to Execute Commands
- “-newer”
- Locate
- Disk Usage (du)
- Display Free Disk Space (df)
18. Regular Expressions
- Purpose of Regular Expressions
- Table of Regular Expressions
- Regular Expressions Modifying other Regular Expressions
- Numerical Qualifiers on Regular Expressions
- Table of Extended Regular Expressions
- Real-World Example, Part 4
- Despamming E-mail Feeds
19. Filters
- The grep Family
- fgrep
- grep
- egrep
- Word Count (wc)
- Sort
- UNIX version
- Linux version
- Intro to awk, sed, Perl, Python
- Finishing the Real-World Example, Part 5
- Compiling an Ordered, Sorted Unique List of All Machines on the Subnet
20. Processes
- Backgrounding and Foregrounding Processes with bg and fg
- Scheduling a Process to Execute Once with “at”
- Scheduling a Process to Execute Repeatedly with “chron”
- The kill and pkill Commands
- The proc File System
- Viewing System-Wide Information
- Viewing Process-Specific Information
Labs
1. Introduction to the lab environment and using the shell
2. Using, navigating, and searching man pages. Using the Linux info command.
3. Explore different file types: files, directories, devices, and links. Use basic commands to navigate and explore files and directories (cd, 1s, pwd, cat, and date).
4. Explore top-level directories. Use shortcut names to navigate and view directories. Use the file and od commands to view file and directory details. Use the 1s -1 command to view file attributes. Use the cd command with relative and absolute pathnames.
5. Use the touch command to create files and modify timestamps. Use the chon command to change file ownership. Use the 1n command to create a link to a file.
6. Use the chmod command to modify file permissions. Use the umask command to set the default permissions.
7. Copy, move, and remove files. Use tar to archive files. Use gzip to compress files.
8. Perform basic editing and navigation in vi. Operate effectively in both command and insert modes.
9. Explore processes using the ps, pstree, and pgrep commands.
10. Perform globbing with different commands. Quote special characters in the shell. Use command-line shortcuts, such as file completion, command completion, command history, and repeating commands, to more efficiently work in the UNIX shell.
11. Modify your UNIX profile, including your unmask, setting your path, setting your own variables, setting aliases, setting options, and defining functions. Edit the .forward file.
12. Create a shell script using a text editor, such as vi. Include comments, white space, and the shbang line. Include the echo and read commands in the script. Give yourself execution permission for the script. Run the script to make sure that it works. Address any problems that prevent the script from running correctly.
13. Redirect the output of standard out and standard error to files. Implement noclobber to prevent file destruction. Use piping to send the standard out of one command to the standard in of another command.
14. Use the four methods for performing conditional testing (|| and &&, test command, [ ], and [[ ]]) to write conditional statements into a script. Use if, then, if and elif statements.
15. Introduce various types of loops (for, while, until) into your script. Use the seq command. Implement abnormal loop termination.
16. Use find and locate to find files based on partial information. Use the du and df commands to monitor disk usage.
17. Use various regular expressions to force a command to display only a specific portion of its full output.
18. Use grep and egrep to find regular expressions within a file. Use wc to return word count. Sort files. Use sed and awk to manipulate the data within a file.