In this class you will learn about the UNIX and Linux operating systems. You will learn what UNIX and Linux are, and then spend most of the class learning how to use the command line interface. That is, you will learn a whole bunch of UNIX commands, but you will have to type them. Learning to type commands and harness the power of the command line will help prepare you for the advanced class, Linux Administration & Security (CSIA 430), where you will learn how to administer UNIX/Linux computers.
If you’re pursuing a career in Network Administration or Cyber Security an excellent long term goal is to be able to write your own commands to accomplish the tasks you have as a system admin. But the UNIX command line is complicated enough that a good intermediate goal is to be able to understand small programs called scripts that others have already written. The scripts combine the individual commands to perform complicated tasks that would otherwise require a program written in a 4th level language such as C++ or Java. So this class has been designed to teach you the individual commands and ways to combine the commands into scripts, with the goal of being able to take existing scripts and adapt them to your needs. I think you will be successful if you can take something like:
grep ‘^sako\.html\? ‘ *.htm | sed s@sako@tsako@g > examplePipe.out$$
and understand what it does, then modify it to meet your needs. (Yes, even though it looks like the cat walked across the keyboard, this command really does something.)
You will also learn about basic file system security, the different UNIX/Linux disk partitions and the file system, which are necessary if you are planning on going into Cyber Security.
0 – Course Introduction
- Getting Started in This Course – Read This First
- How to Determine Your Class Mode
- What You Will Learn – Course Purpose
- The Buy-In (Video)
- Syllabus (Note this copy of the syllabus is not updated regularly. The most current version can be found in Canvas.)
- Instructor Biography and Contact Information
- Course Resources
- Canvas Tips – Best Way to Use Canvas in This Class (Video)
- Buying Labsim (Video)
- Buying Labsim (PDF)
- If you purchase the wrong Labsim or need help with your purchase
- Creating Your Labsim/Testout Account
- Enroll in Your Labsim Class
- Tips on Using Labsim (Video 7:42)
- Labsim Roadmap – Which Items to Complete (Video)
- Lab Manual (PDF)
- Lab Manual – Instructions for formatting answers and file submission (PDF)
- Grading and Late Work Policies
- Course Attendance Policy
- Other College and Course Policies
- Certifications – The Linux+ and Linux Pro Exams, and how they relate to this class (Video)
- Ways to Get Help Succeeding In This Class and at CBC
1 – Introduction to Linux & UNIX
- Chapter 1
- History of UNIX/Linux – Part 1 (Video 7:35)
- History of UNIX/Linux – Part 2 (Video 3:59)
- OS Basics, UNIX vs. Windows (Video 9:48)
- Ways to Practice Linux Commands, Terminal Emulator Basics (Video)
- Downloading, Installing and Starting putty (Video)
- Putty Basic Putty Basic Configuration – changing screen and font size, changing colors, and saving the settings in a session (Video)
- Debugging Problems Connecting To CBC Linux Server (Video 3:48)
- Changing your password (Video 2:14)
- Using the Labsim VM for practice (Video 6:03)
- OPTIONAL – Running LINUX off thumb drive (Video 6:25)
2 – First Commands: Moving Around the File System and Displaying Files
- Chapter 2 – Linux/UNIX Command Line Book
- Chapter 2 – Linux/UNIX Command Line Book (Google Docs)
- [OPTIONAL] Logging In to your own Linux server or VM. You’ll only do this if you installed your own server or VM. You will NOT need this if you’re using your account on the CBC Linux server.
- Section intro, Basic command structure, and the ls command for viewing files (Video 6:48)
- Command options and arguments (Video 8:37)
- Displaying file contents with the more command (Video 1:43)
- Getting help with commands (Video 7:32)
- Using apropos to find commands (Video 2:59)
- Changing directories with cd (Video 3:44)
- Relative and Absolute Paths (Video 12:00)
- Typical Linux/UNIX directories (Video 9:45)
- Using df to view drives and partitions (Video 7:01)
- Information about you and other users (Video 2:09)
- User shell data with set (Video 2:21)
- Finger and chfn (Video 4:22)
- Finger plan (Video 3:34)
- Communicating with other users mail, talk, chat, mesg (Video 5:32)
3 – Creating Files and Directories, Permissions
- Chapter 3 – Linux Command Line Book
- Using WinSCP to Copy Files Between PC and UNIX Host (Video 3:19)
- Using WinSCP Video (Video 4:58)
- Demo of Creating A file on the PC and Copying to UNIX Host Video (Video 2:46)
- Winscp and Translating Carriage Return Line Feeds (Video 1:53)
- Creating Files with touch Video (Video 3:38)
- UNIX File Name Conventions (Video 9:15)
- Optional – The file Command For Determining File Type (Video 2:57)
- Making Directories (Video 1:11)
- Deleting Files with rm Video (3:02)
- Forensics Details and shred (Video 2:31)
- Deleting Directories (Video 5:25)
- Displaying File Content (Video 4:28)
- The head and tail Commands Video (2:32)
- Copying Files with cp (Video 7:14)
- Renaming Files with mv (Video 3:47)
- Creating Links (Shortcuts) with ln (Video 3:09)
- Interpreting Permissions (Video 7:09)
- Setting Permissions with chmod (Video 6:42)
- Creating An Executable Script For Testing Execute Permissions (Video 7:55)
- chmod Examples and Testing Permissions (Video 6:27)
- Directory Permissions (Video 5:09)
- Testing Directory Permissions (Video 5:04)
- Introduction to Changing Default Permission with umask (Video 8:36)
- [OPTIONAL] umask in Symbolic Mode (Video) Note – this does not work on the CBC Linux server
- Suggested Default Permissions (Video 8:57)
- Setting Default Directory Permissions With umask (Video 6:23)
- Symbolic Mode For chmod (Video 5:14)
- OPTIONAL – umask Binary Details (Video 4:29)
- OPTIONAL – the setuid mystery (Video 5:52) – you’ll actually need this to answer some of the quiz questions, but it’s an advanced topic
- OPTIONAL – setuid Explained (Video 8:25)
- OPTIONAL – The Sticky Bit (Video 3:47)
4 – vi
- Chapter 4 – Linux Command Line Book
- Help with Lab Manual Assignments (Video)
- Introduction to vi (2:52)
- Opening, Editing & Saving (8:10)
- Opening File From Command Prompt, Different Ways to Save Files (4:56)
- Switching From Command Mode to Insert Mode (3:51)
- hjkl – Moving the Cursor (1:39)
- rsC – Changing Text (2:00)
- Modifying Commands With A Number (2:09)
- Undo and Redo (1:12)
- Repeat Last Command (2:31)
- Find and Replace (7:52)
- Copy, Cut, Paste and Join (3:48)
- Setting vi Options (2:51)
- Changing vi colorscheme (2:54)
- Permanently Changing vi Options (2:22)
- vi Wrapup (1:23)
Test Questions
- Test 1 Questions (PDF)
- Test 2 Questions (PDF)
- Extra Credit (PDF)
5 – Filename Wildcards, Pipes and Redirects, and Protecting Special Characters
- Chapter 5 – Linux Command Line Book
- Section Introduction and What is a glob (Video 2:38)
- Matching Any Characters In Filenames With * (Video 8:55)
- Matching A Single Character In A Filename With ? (Video 3:01)
- Matching Limited Sets Of Characters With [ ] (Video 4:51)
- Matching A Character Range (Video 2:19)
- Multiple Ranges (Video 2:28)
- Matching Strings In Filenames With { } (Video 2:54)
- UNIX Pronunciation Guide (Video 2:38)
- The ~ (tilde) Character As A Shortcut For Your Home Directory (Video 1:44)
- Anything That Starts With $ Is A Variable (Video 4:09)
- Printing To The Screen – Tabs & Newlines (Video 4:30)
- Echoing Tabs & Newlines In Bash (Video 2:15)
- Accessing Previous Commands With ! (Video 2:03)
- How To Protect Special Characters (Video 2:35)
- Protecting or Escaping A Single Character With \ (Video 7:13)
- Hard Protection With Single Quotes (Video 8:34)
- Soft Protection With Double Quotes (Video 4:58)
- Wildcard Recap & Intro To Redirection (Video 2:15)
- Redirecting Output To A File (Video 5:25)
- Solving The cat > filename Mystery (Video 2:27)
- Protecting From Accidental Overwrite (Video 5:10)
- Appending With >> (Video 3:52)
- Introduction To Pipes (Video 6:49)
- Searching For Strings INSIDE A File With grep (Video 3:13)
- The sort Command Basics (Video 4:46)
- The cut Command (Video 7:18)
- The paste Command (Video 5:19)
- The join Command (Video 4:21)
- The uniq Command (Video 1:36)
- Converting Text Case With tr (Video 7:02)
- Changing Text With The Stream Editor sed (Video 3:23)
- Details For The sed Command (Video 5:23)
- Deleting Text With sed (Video 3:22)
- Commands For Starting Pipes (Video 2:56)
6 – Regular Expressions
- Chapter 6 – Linux Command Line Book
- Introduction To Regular Expressions (4:55)
- Using grep And Regular Expressions To Search For Text In A File (4:49)
- Using grep To Search Multiple Files (3:06)
- Matching Any Single Character In A Regular Expression With . (5:51)
- Matching Any Character From A Set With [ ] And The LC_ALL Fix (5:44)
- Using ^ To NOT Match Characters (4:47)
- The Occurrence Modifier – Using {n} TO Specify How Many Wildcards To Match (6:12)
- Setting A Range Of Occurrences With {x,y} (2:13)
- The * (0 or More) and + (1 or More) Modifers (8:43)
- Specifying One Expression OR Another With | (4:23)
- Specifying Position In Line For Regular Expression (4:10)
- Specifying Beginning Or End Of A Word (3:34)
- PERL Extensions To Regular Expressions (4:13)
7 – The Shell
- Chapter 7 – Linux Command Line Book
- What Are UNIX/Linux Shells? (9:42)
- Linux Shell Roundup: 15 Most Popular Open Source Linux Shells – From Ubuntu Pit by Mehedi Hasan
- Changing Your Login Shell With chsh (6:35)
- Shell Command Processing – Built-In Commands (6:31)
- Is a Command Built-In Or Not? (6:09)
- Specifying The Path To A Command (3:51)
- The Search Path, Specifying Command Directories (7:19)
- Changing Your $path Variable (4:57)
- Suggestions For $path, Put Current Directory Last If You Add It (6:16)
- Adding $path Changes To Your Startup File(s) To Make Changes “Permanent” (4:01)
- Rebuilding The $path Command Table With rehash (4:40)
- Command Aliases (2:57)
- Making Aliases “Permanent” (4:26)
- Passing Arguments To An Alias (8:06)
- Command Processing Order (7:35)
- Shell History – Repeating Commands (5:24)
- History Substitution (2:41)
- Shell Variables For Controlling Shell History (6:09)
- Shell Variables (6:55)
- The noclobber and ignoreeof Shell Variables (3:54)
- The source command for testing startup files (2:26)
- Changing Your Shell Prompt (6:56)
- What Are prompt2 And prompt3 (3:18)
- Job Processing (3:58)
8 – Shell Scripts
Chapter 8 – Linux Command Line Book
Introduction To Shell Scripts (4:08)
Writing Your First Script – Hello World (4:04)
Comments (3:00)
Printing With echo (3:21)
Ascii Art (5:14)
Protecting Characters Again (3:05)
Variables – Saving Data For Later Use (4:38)
Variable Scope, Environmental Variables And Process Variables (5:52)
Printing Dollar Signs and Variable Values (3:22)
Numeric Calculations With bc (8:38)
Using Parentheses In bc To Change Order Of Precedence (4:06)
bc Built In Functions (3:07)
Saving bc Output In A Variable (3:13)
Reading Data Or User Input With The read Command (4:27)
Reading More Than One Input And Dealing With Extra Input (6:57)
Example Of Reading, Calculating And Printing Output (3:53)
Example Of Calculating Hypotenuse (6:11)
Making Decisions With The if Statement (4:42)
Testing Greater Than, Less Than etc. (1:50)
else And elif (1:47)
Repeating Code – A Basic For Loop (Video)
Controlling The Start, End and Increment in a For Loop (Video)
Reading User Input To Control For Loop (Video)
Checking For and Preventing Infinite Loops (Video)
Using A For Loop To Process A Collection of Files Or Strings (Video)
Asking A User If They Want To Loop Again (Video)
Making The Previous Code More Robust (Video)
Combining While Loop And For Loop, Asking User If They Want To Run Weight Calculator (Video)