LinuxLecture is a beginner-friendly Linux lecture deck written with LaTeX Beamer. It introduces students to the Linux shell, basic file operations, text editing with Vim, input/output redirection, downloads and archives, Unix file permissions, process control, and basic Slurm job scheduling.
The repository includes both the editable source (linux.tex) and a generated
PDF (linux.pdf) so that instructors can either present the existing slides or
modify and rebuild the deck.
- Audience
- Repository Contents
- Quick Start
- Build Requirements
- Lecture Outline
- Suggested Student Workflow
- Safety Notes
- Customizing the Lecture
- License
This material is intended for first-time Linux users in a classroom, lab, or shared server environment. The examples assume that learners can open a Linux shell through one of these setups:
- Ubuntu LTS, Windows Subsystem for Linux, or another Linux desktop
- A remote Linux server reached through SSH
- A course-provided shell environment
- A terminal running
bashorzsh
The commands are intentionally simple and use common tools that are available on most Linux systems.
| Path | Description |
|---|---|
linux.tex |
Main LaTeX Beamer source for the lecture slides. |
linux.pdf |
Prebuilt PDF version of the lecture. |
figures/ |
Images and screenshots used by the slides. |
LICENSE |
MIT license for the repository. |
README.md |
This project overview and usage guide. |
To use the lecture immediately, open linux.pdf in any PDF viewer.
To edit the lecture, modify linux.tex and rebuild the PDF:
latexmk -pdf linux.texIf latexmk is not available, you can use pdflatex directly:
pdflatex linux.tex
pdflatex linux.texRunning pdflatex twice helps LaTeX update cross-references and the table of
contents.
You need a LaTeX distribution that includes Beamer and common graphics support.
Recommended options:
- macOS: MacTeX
- Ubuntu/Debian:
texlive,texlive-latex-extra, andlatexmk - Windows: TeX Live, MiKTeX, or WSL with TeX Live
On Ubuntu or Debian-based systems, a typical setup is:
sudo apt update
sudo apt install texlive texlive-latex-extra latexmkThe deck is organized as a practical introduction. Each topic starts with the reason the command matters, then shows small commands that students can type in a terminal.
This section introduces Linux as an open source operating system family and Ubuntu as a common beginner-friendly Linux distribution. It gives students the context they need before they begin typing commands.
Students learn how to move around the filesystem and manage files:
pwdprints the current working directory.lslists files and directories.mkdircreates a new directory.cdchanges the current directory.- Tab completion helps complete commands and paths.
manand--helpprovide command documentation.touchcreates an empty file or updates a file timestamp.mvmoves or renames files.cpcopies files.rmremoves files and directories.sudoruns commands with elevated privileges when allowed.
This part also explains important directory concepts such as the home directory,
. for the current directory, and .. for the parent directory.
The editor section introduces common terminal editors and uses Vim as the main example because it is widely available on Linux servers. Students learn the basic Vim workflow:
- Open a file with
vim filename. - Press
ito enter insert mode. - Edit the file.
- Press
Escto return to normal mode. - Save with
:w. - Quit with
:q.
The deck also points students to vimtutor for optional practice.
This section explains how commands read input and write output:
catprints file contents.>writes output to a file and overwrites existing content.>>appends output to a file.<reads input from a file.1>redirects standard output.2>redirects standard error.moreandlessdisplay longer files page by page.|pipes the output of one command into another command.
These ideas are important because many Linux workflows are built by connecting small commands together.
Students learn two common download tools:
curlfor fetching URLs and optionally saving output with-owgetfor downloading files directly
The section also covers compressed files and archives:
gzipcompresses or decompresses single files.gzip -kkeeps the original file while compressing.tar -xzf file.tar.gzextracts a compressed tar archive.
These examples are useful for downloading lab files, source code, datasets, or course materials.
The permissions section explains how to inspect and change file permissions:
ls -alshows file modes, owners, groups, and hidden files.chmodchanges read, write, and execute permissions.- Numeric permissions such as
660and770are introduced. - Symbolic forms such as
chmod g=rwx fileandchmod +x fileare shown. chownchanges file ownership.
This topic is especially important on shared servers, where incorrect permissions can expose private files or prevent collaborators from using shared work.
Students learn how to handle long-running commands:
Ctrl-Csends an interrupt signal to stop a foreground process.&starts a command in the background.jobslists background jobs in the current shell.kill %numberstops a background job by job number.kill PIDstops a process by process ID.nohupkeeps a command running after an SSH session disconnects.screenlets users detach and return to terminal sessions.
These commands help students work safely on remote servers.
The final section introduces Slurm for shared clusters. Students learn what a job scheduler does and how to submit, inspect, and cancel jobs:
- Write a shell script with
#SBATCHresource options. - Submit a job with
sbatch. - Choose output and error log files with
--outputand--error. - Check jobs with
squeue -u $USER. - Cancel a job with
scancel JOBID. - Cancel all of a user's jobs with
scancel -u $USER.
The Slurm examples are intentionally small and should be adjusted to match the policies of the cluster or classroom server where the lecture is taught.
For a hands-on lab, students can create a clean practice directory before trying the examples:
mkdir -p ~/linux-lab
cd ~/linux-lab
pwdKeeping practice files in one directory makes it easier to experiment without mixing lab files with personal files.
- Read each command before pressing Enter.
- Be careful with
rm; removed files may not be recoverable. - Be careful with
sudo; it can change system files or affect other users. - On shared machines, avoid running heavy jobs directly in the login shell.
- Follow local Slurm, storage, and server policies when working on a cluster.
Instructors can update linux.tex to match a specific course environment. Common
customizations include:
- Replacing screenshots in
figures/ - Updating SSH, server, or cluster examples
- Changing Slurm resource examples such as time, CPU, memory, partition, or GPU options
- Adding local software installation instructions
- Translating explanations or adding course-specific exercises
After editing, rebuild linux.pdf and review the slides to make sure images,
line breaks, and command examples still fit well.
This repository is released under the MIT License. See LICENSE for the full
license text.