Skip to content
codewithmahadPublic

About

Linux command notes and Bash exercises from my Operating Systems coursework at UBIT.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tux, the original Linux penguin by Larry Ewing. LINUX_LAB

Linux commands, Bash scripts, and the notes I come back to.

This is the Linux and Bash side of my Java/Spring Boot backend work: working with files, running an application, reading its logs, and automating repeated tasks. I started it during my Operating Systems lab at UBIT, University of Karachi, and keep the useful notes and scripts here for revision.

Recorded work: 8 Linux chapters · 4 Bash chapters · 12 Bash practice scripts

Learning map  ·  Practical work  ·  Use the lab  ·  Connected labs

Linux filesystem sketch: the root directory branches into home, var, and opt. Learning map

The Linux and Bash topics I want for backend development. Linked topics open recorded notes, exercises, or project code. Plain text is coverage still to add.

01 · Files, paths, and permissions
02 · Logs and text processing
03 · Processes and the Java runtime
  • Process inspection — ps, pgrep, top, process IDs, and resource use.
  • Foreground and background jobs — jobs, fg, bg, &.
  • Signals and graceful termination — kill, SIGTERM, and SIGKILL.
  • Environment variables — export, printenv, PATH, JAVA_HOME, and inheritance.
  • Packages and JDK selection — apt, command -v, java -version, javac -version.
  • Running an executable JAR — java -jar, arguments, and process exit status.
04 · Networking and remote access
  • HTTP requests — curl, headers, response bodies, status codes, timeouts, and failed requests.
  • Listening ports and binding addresses — ss, localhost, and port conflicts.
  • Basic connectivity and name resolution — ping, hostname, DNS, and hostnames.
  • SSH access — keys, host verification, and ~/.ssh/config.
  • File transfer — scp and basic rsync.
05 · Bash fundamentals GNU Bash logo in grayscale.
  • Shell and script basics — shebangs, execution order, working directories, and executable permissions.
  • Variables and expansion — quoting, ${name}, $(command), arithmetic, splitting, and globbing.
  • Input and output — IFS= read -r, printf, fixed formats, and failed reads.
  • Operators and exit statuses — numeric and string tests, $?, &&, ||.
  • Conditions and menus — if, else, case.
  • Loops — for, while, break, continue.
  • Arrays — indexed and associative arrays, iteration, lookup, and "${items[@]}".
  • Arguments and defaults — $1, $#, "$@", shift, ${name:-default}, and usage messages.
  • Functions and scope — parameters, local, return statuses, and reusable operations.
06 · Bash reliability and debugging
  • Input validation — numeric formats, decimal conversion, ranges, and retry loops.
  • Syntax checks and tracing — bash -n and bash -x.
  • Static analysis and edge cases — ShellCheck, invalid input, EOF, whitespace, and duplicates.
  • Failure handling — explicit status checks, exit, stderr, set -e, set -u, pipefail, and their limits.
  • Cleanup — trap, temporary files, and mktemp.
  • Repeatable runs — checking dependencies, guarding file changes, and handling existing output.
07 · Practical backend workflows
  • Build and test a Java project with its Maven Wrapper.
  • Run a Spring Boot JAR outside the IDE with the intended profile and environment.
  • Test an API and write a health check with a clear HTTP success condition.
  • Diagnose startup failures, occupied ports, and database connection errors.
  • Deploy and recover a Java service — versioned releases, health and version checks, and rollback.
  • Run Java under systemd — service configuration and restart behaviour.
  • Write a build/test/run helper and reuse its build and test steps in CI.
  • Archive sample configuration and logs, restore them elsewhere, and verify the contents.

Docker and Compose come with a later application exercise. Deep administration, advanced networking, Kubernetes, Terraform, and Ansible sit outside this lab's current scope.

DeployLatch emblem: a server lock with deployment and recovery arrows. Practical work

Applied · DeployLatch

For my OS project, I built a Bash tool that deploys a Java service on Ubuntu and verifies its health and version. I tested a working update and recovery from a failed one. It made one distinction clear: a running process can still be unhealthy or running the wrong release.

Deployment script · Update and rollback demo

Browse the practice scripts and their expected behaviour →

Ubuntu Circle of Friends. Using the lab

Ubuntu · Bash · Git · VS Code

Learn a topic, try it, change the input, check the result, and commit the useful part. Short notes and corrections stay with the code so I can return to them later.

Setup and first run

Use a Linux terminal with Bash and Git installed. Ubuntu in WSL or a VM works for the exercises.

git clone https://github.com/codewithmahad/LINUX_LAB.git
cd LINUX_LAB
bash learning/bash-scripting/01-shell-and-script-basics/hello.sh

The greeting is Hello From Bash. Use bash -n path/to/script.sh to check a script's syntax without running it.

Notes and chapter examples live in learning/; standalone exercises in practice/; illustrations and their credits in assets/.

References

Found a mistake? Open an issue with the file, command, and result.

How the labs fit together

This lab keeps my Linux and Bash coursework: files, processes, logs, and scripts. My main programming practice is in the other three labs: Java for the language, DSA for problem solving, and SQL for queries and relational design.

JAVA_LAB DSA_LAB SQL_LAB

Outside this coursework, I keep my coding practice here.

LeetCode: my profile HackerRank: my profile Codolio: my profile


Maintained by Shaikh Mahad  ·  Portfolio  ·  MIT License  ·  Artwork credits  ·  Back to top ↑

About

Linux command notes and Bash exercises from my Operating Systems coursework at UBIT.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages