Hands-on guide series

Storage, Text and Your First Scripts: A Hands-On Guide

A nine-part, hands-on guide to disks and filesystems, tar, the text tools sed, awk, cut, sort and uniq, and writing your first bash script and scheduled backup. Every command run on a live Ubuntu server.

9 parts57 min totalBy Amith Kumar

What you will build

Security is layers, not a switch. Each part closes a different category of attack, from the automated sweep that finds a brand-new server, to the day one gets in anyway. Read them in order, or jump to what you need.

  1. 1Disks and PartitionsMap the linux disks on an Ubuntu 24.04 server: run lsblk to list the disk and its partitions, then df to see how much space is left.6 min
  2. 2Filesystems, Mounts and fstabLearn linux mount and fstab on Ubuntu 24.04: how mount attaches a partition to a directory, findmnt shows what is mounted, and fstab makes it stick.7 min
  3. 3Disk Usage: df and duMaster linux disk usage with df and du on Ubuntu 24.04: df shows free space per filesystem, du shows what fills a directory so you find the culprit.6 min
  4. 4tar and CompressionLearn linux tar and compression on Ubuntu 24.04: use tar to bundle a directory into one archive, gzip to shrink it, then list and extract it.6 min
  5. 5Text Processing With sedUse the linux sed command on Ubuntu 24.04 to find and replace text as it streams past, editing a log from a script without opening an editor.6 min
  6. 6Text Processing With awkUse the linux awk command on Ubuntu 24.04 to read text as columns: pull specific fields from a log or CSV and add them up into the numbers you need.6 min
  7. 7cut, sort, uniq and trCombine linux cut, sort and uniq in a pipe on Ubuntu 24.04 to count how often each value appears in a file, the pattern behind many one-liners.6 min
  8. 8Your First Bash ScriptA bash script tutorial for Ubuntu 24.04: write your first script with a shebang, a variable and a condition, make it executable, and run it.7 min
  9. 9Scheduling an Automated BackupWrite a linux backup script and a cron entry on Ubuntu 24.04 so a directory is archived every night on its own, tying the whole series together.7 min