Skip to content

Module 2 Summary — Linux Command Line Essentials

Congratulations! 🎉 You have completed Module 2: Linux Command Line Essentials. In this module, you learned how to interact with Linux using the command line—the most powerful interface for Linux Administration, Cloud Engineering, DevOps, Platform Engineering, and Cybersecurity.


Module Overview

The Linux Command Line is the primary interface used by professionals to manage systems, automate tasks, troubleshoot issues, and deploy applications.

By completing this module, you've built the skills needed to confidently navigate Linux systems and execute commands efficiently.


Lessons Covered

Lesson Topic
Lesson 1 Understanding the Shell
Lesson 2 Bash Basics
Lesson 3 Navigating the Filesystem
Lesson 4 File and Directory Commands
Lesson 5 Viewing File Contents
Lesson 6 Searching Files and Directories
Lesson 7 Wildcards and Globbing
Lesson 8 Command History
Lesson 9 Input, Output & Redirection
Lesson 10 Pipes

What You Learned

By completing this module, you can now:

  • Understand how the Linux Shell works
  • Use Bash efficiently
  • Navigate the Linux filesystem
  • Create, copy, move, rename, and delete files
  • View and inspect files
  • Search files using powerful Linux commands
  • Use wildcards to work with multiple files
  • Reuse commands using Bash history
  • Redirect input, output, and errors
  • Build powerful Linux command pipelines

Command Categories

Shell Commands

echo

type

which

whereis

history

alias

unalias

pwd

cd

ls

tree

File Management

touch

mkdir

cp

mv

rm

rmdir

Viewing Files

cat

less

more

head

tail

nl

tac

wc

file

Search Commands

find

locate

which

whereis

type

Wildcards

*

?

[]

[a-z]

[!]

{}

Redirection

>

>>

<

2>

2>>

2>&1

Pipes

|

tee

Command Reference

Command Purpose
pwd Show current directory
ls List files
cd Change directory
mkdir Create directory
touch Create file
cp Copy files
mv Move/Rename
rm Delete files
cat Display file
less Read large files
head First lines
tail Last lines
find Search files
locate Fast file search
history Command history
grep Search text
wc Count lines/words
tee Display and save output

Linux Command Flow

User


Shell (Bash)


Command


Linux Kernel


Output


Terminal

Pipe Workflow

Command 1


Output


Pipe


Command 2


Result

Example:

cat users.txt | sort | uniq | wc -l

Redirection Flow

Command


stdout


File

Example:

ls > files.txt

Error:

ls missing.txt 2> errors.log

Practical Assessment

Complete the following tasks without referring to previous lessons.


Task 1

Create the following structure.

linux-lab

├── scripts

├── configs

├── logs

└── backup

Task 2

Create files.

deploy.sh

backup.sh

config.yaml

app.log

README.md

Task 3

Copy:

config.yaml

to

backup/

Task 4

Rename:

deploy.sh

to

deploy-production.sh

Task 5

Display:

  • Current directory
  • Hidden files
  • Detailed listing

Task 6

Search:

  • YAML files
  • Shell scripts
  • Log files

Task 7

Display:

  • First three lines
  • Last two lines

of README.md.


Task 8

Redirect output.

ls -la > files.txt

Append current date.

date >> files.txt

Task 9

Count files.

ls | wc -l

Task 10

Display only shell scripts.


Mini Project

Build a Project Workspace

Create the following structure.

linux-project

├── app

│   ├── app.py

│   ├── requirements.txt

│   └── Dockerfile

├── configs

│   ├── nginx.conf

│   └── app.yaml

├── scripts

│   ├── deploy.sh

│   └── backup.sh

├── logs

└── backup

Requirements:

  • Create directories
  • Create files
  • Copy configs
  • Rename files
  • Search files
  • Display file contents
  • Use pipes
  • Use redirection

Production Scenarios

Scenario 1

A production server has over 20,000 log files.

Find:

  • Today's logs
  • Files larger than 500 MB

Scenario 2

Your application has crashed.

Tasks:

  • Find configuration files.
  • View logs.
  • Count ERROR entries.
  • Save output.

Scenario 3

Find:

  • Running Docker containers.
  • Running Kubernetes Pods.
  • SSH processes.

Scenario 4

An administrator accidentally deleted a configuration file.

Restore from backup and verify.


Scenario 5

Find every shell script inside:

/opt/scripts

and make a backup.


Command Challenge

Without using the mouse:

Complete the following.

  • Navigate directories
  • Create files
  • Rename files
  • Copy directories
  • Delete files
  • Search files
  • Display file contents
  • Redirect output
  • Build pipelines

Time limit:

15 Minutes


Knowledge Check

Beginner

  1. What is Bash?
  2. What is the Shell?
  3. Difference between Shell and Terminal?
  4. What does pwd do?
  5. What does cd do?
  6. What does ls -la display?
  7. Which command creates a file?
  8. Which command copies files?
  9. Which command deletes files?
  10. What is a pipe?

Intermediate

  1. Explain PATH.
  2. Difference between > and >>.
  3. Explain tail -f.
  4. Difference between find and locate.
  5. Explain wildcard expansion.
  6. Difference between absolute and relative paths.
  7. Explain tee.
  8. Explain command history.
  9. Difference between stdout and stderr.
  10. Explain pipelines.

Architect Level

  1. Why is Bash still widely used?
  2. Why should administrators master pipelines?
  3. Explain Linux command execution.
  4. How would you troubleshoot an application using only the command line?
  5. How do command-line skills improve DevOps automation?

Multiple Choice Quiz

1. Which command shows the current directory?

A. ls

B. pwd

C. cd

D. cat


2. Which command creates an empty file?

A. mkdir

B. touch

C. cp

D. mv


3. Which wildcard matches any number of characters?

A. ?

B. *

C. []

D. {}


4. Which command searches the filesystem?

A. grep

B. find

C. cat

D. pwd


5. Which symbol appends output?

A. >

B. >>

C. <

D. |


6. Which command monitors a growing log file?

A. cat

B. head

C. tail -f

D. less


7. Which command displays previous commands?

A. ps

B. history

C. grep

D. alias


8. Which command counts lines?

A. head

B. wc

C. cat

D. nl


9. Which command identifies the location of an executable?

A. whereis

B. locate

C. which

D. find


10. What does a pipe (|) do?

A. Deletes files

B. Copies files

C. Sends output from one command to another

D. Creates directories


Quiz Answers

Question Answer
1 B
2 B
3 B
4 B
5 B
6 C
7 B
8 B
9 C
10 C

Best Practices

  • Learn keyboard shortcuts.
  • Use Tab Completion frequently.
  • Use less instead of cat for large files.
  • Preview wildcard matches before deleting files.
  • Use pipes instead of temporary files.
  • Redirect logs for troubleshooting.
  • Practice command-line navigation daily.

Common Mistakes

❌ Using rm -rf without verification.

✅ Avoid using rm -rf without verification when a safer approach exists.


❌ Overwriting important files using >.

✅ Avoid this mistake: overwriting important files using >.


❌ Searching the entire filesystem unnecessarily.

✅ Narrow the search instead of the entire filesystem unnecessarily.


❌ Ignoring error output.

✅ Always review error output.


❌ Re-typing long commands instead of using history.

✅ Prefer using history rather than re-typing long commands.

Module Cheat Sheet

pwd
cd
ls
tree

Files

touch
mkdir
cp
mv
rm

Viewing

cat
less
head
tail
wc

find
locate
which
whereis

Wildcards

*
?
[]
{}

Redirection

>
>>
<
2>
2>&1

Pipes

|
tee

Production Readiness Checklist

Before moving to Module 3, ensure you can confidently:

  • Navigate the Linux filesystem without assistance.
  • Create, copy, move, and delete files safely.
  • View and analyze large log files.
  • Search for files using different criteria.
  • Use wildcards to manage multiple files.
  • Reuse commands with Bash history.
  • Redirect input, output, and errors.
  • Build multi-stage command pipelines.

If you can complete these tasks comfortably, you're ready for the next module.


What's Next?

cat Command

Congratulations!

You have completed Module 2 – Linux Command Line Essentials.

Next, you'll begin Module 3 – Text Processing, where you'll learn to transform logs and configs with classic Unix filters.

Topics include:

  • cat (quick review)
  • grep, cut, sort, uniq, tr, and wc
  • paste, join, split, fmt, column, and strings
  • tee and xargs
  • sed and awk
  • Regular Expressions
  • Real-world log analysis and DevOps workflows

Downloadable Resources (Coming Soon)

  • Linux Command Line Cheat Sheet (PDF)
  • Bash Command Reference
  • Mind Maps
  • Hands-on Lab Workbook
  • Interview Preparation Guide
  • Practice Exercises

"The Linux command line isn't just a tool—it's the language of automation, infrastructure, and modern engineering."

REBASH Academy