Ravindra BagaleCourses & study guides मराठी Track your progress

AWS Cloud

Linux Commands A-Z Part 2: chronyc, crontab, curl, cut, date, dd, df, diff, dig, dnf and du with Examples

This is Part 2 of the Linux Commands A-Z reference: chronyc to du. These are the commands you use when time is wrong, a server will not boot, files must be compared, jobs must be scheduled, a website or DNS must be tested, and a disk is full. Every command has why, what, an options table and step-by-step examples with real output and its meaning. cp is already covered in depth earlier, so it is linked.

In this chapter

  • Check and fix server time with chronyc and date
  • Repair a broken system with chroot and inspect kernel messages with dmesg
  • Compare files and lists with cmp, comm, diff and cksum
  • Schedule repeating jobs safely with crontab
  • Test websites and DNS with curl and dig
  • Find what fills a disk with df and du, and manage RPM packages with dnf

1. An everyday example: a PMPML bus depot at night

At the Hadapsar depot, the night supervisor checks that every bus clock matches the depot clock, compares today's route sheet with yesterday's, schedules the 5 AM departures, phones the control room to confirm the routes are open, and checks the diesel tank level before the morning rush.

chronyc and date are the clock check. diff, comm and cmp are the route sheet comparison. crontab is the departure schedule. curl and dig are the phone call to the control room. df and du are the diesel tank level.

A night check on a serverClock in syncConfigs unchangedJobs scheduledSite and DNS OKDisk has roomKernel log clean
The same six checks, run with commands from this part.

2. A five-minute health check using Part 2 commands

Before you dive into one command, see how they work together in a real check.

One command per question. Each line answers one thing a manager or on-call engineer will ask.

QuestionCommand
Is the clock right?chronyc tracking
Is the disk full?df -h
Is the site up?curl -I
Does DNS point right?dig +short
Any hardware errors?dmesg -T -l err
  1. Run the check in one go.
chronyc tracking | grep "System time"; df -h / | tail -1; curl -s -o /dev/null -w "%{http_code}\n" http://localhost/

Output:

System time     : 0.000040 seconds fast of NTP time
/dev/nvme0n1p1   20G  9.1G   11G  46% /
200

Clock fine, disk at 46%, web server answering 200.

  1. Add a kernel check.
sudo dmesg -T -l err | tail -2

No output means no recent kernel errors.

3. chronyc: Check and control time sync

When two servers appear to disagree about the incident time, make the time zone explicit. Use date -u to compare the displays in UTC. Then use chronyc tracking to read the time source and the offset being corrected. The date display’s zone and the clock’s offset are different causes of disagreement. Record both before lining up logs from the two machines.

chronyc in depth: is my server clock in sync?

Wrong time breaks TLS certificates, Kerberos and AD logins, cron jobs and log timelines. When two servers disagree by even a few minutes, debugging becomes very hard.

chronyc is the control tool for chronyd, the NTP service on RHEL, Rocky, Amazon Linux and many Ubuntu servers. It shows the sources the server uses, how far off the clock is, and can force a step correction.

Common options

OptionWhat it does
chronyc trackingCurrent offset and stratum.
chronyc sources -vTime sources with an explanation header.
chronyc sourcestatsDrift and accuracy per source.
chronyc makestepStep the clock now.
chronyc activityHow many sources are online.
chronyc -n sourcesNumeric, no DNS lookups.
  1. Check the service.
systemctl is-active chronyd

Output:

active

chronyd must run for chronyc to answer.

  1. See the sources.
chronyc sources

Output:

MS Name/IP address         Stratum Poll Reach LastRx Last sample
^* 169.254.169.123               3   4   377    12   -21us[  -30us] +/-  512us

^* marks the source in use. Reach 377 means the last 8 polls worked.

  1. How far off are we?
chronyc tracking | grep -E "System time|Stratum"

Output:

Stratum         : 4
System time     : 0.000021 seconds slow of NTP time

21 microseconds slow: very healthy.

  1. Fix a big jump after a VM resume.
sudo chronyc makestep

Output:

200 OK

The clock jumps to the right time at once instead of slowly drifting.

Practise this in the tasks below: Practice tasks

Real use: A stock-broking firm in Deccan alerts if chronyc tracking shows more than 100 ms offset, because trade timestamps must be exact.

4. chroot: Run a shell inside another root folder

chroot in depth: repair a broken system from rescue mode

When a server cannot boot, you start a rescue disk, mount the broken root disk and need to run its own tools, such as passwd, grub2-install or dracut. chroot lets you do that.

chroot runs a command (by default a shell) with a different folder as /. Programs inside see only that tree. It is not a security sandbox for root; containers use namespaces instead.

Common options

OptionWhat it does
chroot /mnt/sysimageShell with /mnt/sysimage as root.
chroot /sysrootUsed in rd.break root password reset.
chroot DIR cmdRun one command inside.
mount --bind /dev DIR/devGive the chroot real devices.
exitLeave the chroot.
  1. Mount the broken root.
mount /dev/vda4 /mnt/sys

The damaged system is now a folder.

  1. Bind the special filesystems.
for d in dev proc sys; do mount --bind /$d /mnt/sys/$d; done

Tools inside need /dev, /proc and /sys.

  1. Enter it.
chroot /mnt/sys

Output:

[root@rescue /]#

You are now "inside" the broken server.

  1. Rebuild the initramfs.
dracut -f --regenerate-all

Fixes many "cannot find root" boot errors.

  1. Leave and reboot.
exit; reboot

The server boots with the repaired files.

Practise this in the tasks below: Practice tasks

Real use: A data-centre engineer in Talawade uses chroot from a rescue ISO to reinstall GRUB on a server that stopped booting after a disk swap.

5. cksum: Print a CRC checksum and size

cksum in depth: quick CRC checks

After copying a big file between servers you want a quick check that nothing changed. cksum is on every Unix system, even very old ones.

cksum prints a CRC-32 checksum, the size in bytes and the file name. CRC catches accidental corruption but not deliberate tampering; use sha256sum for security. Newer coreutils also support -a sha256.

Common options

OptionWhat it does
cksum fCRC and size.
cksum a bMany files.
cksum -a sha256 fUse SHA-256 (coreutils 9+).
cksum -a md5 fUse MD5.
cksum --check sumsVerify a list (with -a).
  1. Checksum a file.
cksum backup.tar

Output:

2741519874 3221225472 backup.tar

CRC value, then size in bytes, then name.

  1. Check the copy on the other server.
ssh dr01 cksum /backup/backup.tar

Output:

2741519874 3221225472 /backup/backup.tar

Same CRC and size: the copy is fine.

  1. Use SHA-256 if available.
cksum -a sha256 backup.tar

Output:

SHA256 (backup.tar) = 9f2c...e1

A stronger hash with the same tool.

Practise this in the tasks below: Practice tasks

Real use: A government records office in Pune checks cksum on scanned archives after each nightly copy.

6. clear: Clear the terminal screen

clear in depth: a clean screen and reset

During demos, screen-shares or long debugging, a messy screen hides the output you care about. Sometimes binary output also breaks the terminal so you see junk characters.

clear clears the visible screen using terminal codes. Ctrl+L does the same in bash. reset re-initialises a terminal that shows garbage after you cat a binary file.

Common options

OptionWhat it does
clearClear the screen.
Ctrl+LShortcut in bash.
clear -xKeep the scrollback.
resetFix a broken terminal.
tput resetAnother way to reset.
  1. Clear before a demo.
clear

The prompt moves to the top.

  1. Break the terminal by mistake.
cat /usr/bin/ls

Output:

ELF>...@...(garbage)

Binary bytes change terminal settings.

  1. Fix it.
reset

Normal letters again. Type it even if you cannot see what you type.

Practise this in the tasks below: Practice tasks

Real use: A trainer at a Shivajinagar institute presses Ctrl+L between examples so students see only the next command.

7. cmp: Compare two files byte by byte

Make two identical test files and compare with cmp. It can produce no text and still give you a successful status. Change one character and repeat. Status 1 identifies a real difference, and the printed position helps locate it. A missing file is an error instead. Test all three outcomes before using the command to decide whether a restored file is correct.

cmp in depth: are two files byte-identical?

For binary files like images, firmware or archives, diff is not helpful. You just want to know if they are the same and where they first differ.

cmp compares two files byte by byte. It prints the first difference and exits 1, or prints nothing and exits 0 when they match. Exit code 2 means an error. That makes it perfect for scripts.

Common options

OptionWhat it does
cmp a bFirst difference.
cmp -s a bSilent, only exit code.
cmp -l a bList every differing byte.
cmp -n 100 a bCompare first 100 bytes.
cmp -i 10 a bSkip 10 bytes first.
  1. Compare two builds.
cmp app-v1.bin app-v2.bin

Output:

app-v1.bin app-v2.bin differ: byte 4097, line 12

They differ starting at byte 4097.

  1. Use it in a script.
cmp -s new.conf /etc/app.conf || echo "config changed"

Output:

config changed

-s prints nothing; the exit code drives the logic.

  1. Check exit code directly.
cmp -s a.png a-copy.png; echo $?

Output:

0

0 means identical.

Practise this in the tasks below: Practice tasks

Real use: An embedded team in Bhosari checks firmware images with cmp -s before flashing devices.

8. column: Format text into neat columns

column in depth: turn messy output into a neat table

CSV files and colon-separated files like /etc/passwd are hard to read on screen. column lines them up so you can read them like a table.

column -t creates a table, guessing column widths. -s sets the input separator. Newer util-linux versions add -o for the output separator, -N for headers and -J for JSON.

Common options

OptionWhat it does
column -tMake a table.
column -t -s,Comma separated input.
column -t -s: Colon separated input.
column -t -N A,B,CAdd header names.
column -t -J -N a,bJSON output.
column -t -o " | "Output separator.
  1. Read a CSV nicely.
column -t -s, sales.csv | head -3

Output:

date        city    amount
2026-10-01  Pune    1000
2026-10-01  Nashik  450

Columns are now aligned.

  1. Read /etc/passwd as a table.
head -3 /etc/passwd | column -t -s:

Output:

root    x  0  0  root    /root     /bin/bash
bin     x  1  1  bin     /bin      /sbin/nologin

Each field gets its own column.

  1. Tidy mount output.
mount | column -t | head -2

Output:

proc   on  /proc  type  proc   (rw,nosuid)
sysfs  on  /sys   type  sysfs  (rw,nosuid)

Space-separated output also works.

Practise this in the tasks below: Practice tasks

Real use: A retail analytics team in Kalyani Nagar previews CSV exports with column -t before loading them into a database.

9. comm: Compare two sorted files line by line

comm in depth: what is only in A, only in B, or in both

You have two lists, such as users on two servers or packages before and after an upgrade, and need to see what is missing or added.

comm needs two sorted files. It prints three columns: lines only in file 1, lines only in file 2, and lines in both. -1, -2 and -3 hide columns.

Common options

OptionWhat it does
comm a bThree columns.
comm -12 a bOnly lines in both.
comm -23 a bOnly in a.
comm -13 a bOnly in b.
comm <(sort a) <(sort b)Sort on the fly.
comm --check-order a bWarn if not sorted.
  1. Save sorted package lists.
rpm -qa | sort > before.txt

Snapshot before the upgrade.

  1. After the upgrade, save again.
rpm -qa | sort > after.txt

Second snapshot.

  1. See only new versions.
comm -13 before.txt after.txt | head -2

Output:

kernel-5.14.0-427.el9.x86_64
openssl-3.0.7-27.el9.x86_64

Column 3 view: lines only in after.txt.

  1. Users on both servers.
comm -12 <(cut -d: -f1 /etc/passwd | sort) <(ssh web02 cut -d: -f1 /etc/passwd | sort)

Output:

arjun
priya
root

Common users only.

Practise this in the tasks below: Practice tasks

Real use: A university IT team in Ganeshkhind uses comm to find student accounts present in LDAP but missing on the lab servers.

10. crontab: Schedule repeating jobs

crontab in depth: schedule repeating jobs safely

Backups, report emails, log clean-up and certificate renewals must run every night or every hour without anyone pressing a button.

crontab edits the per-user table read by the cron daemon (crond). Each line has five time fields (minute, hour, day of month, month, day of week) and a command. Cron runs with a small PATH and no terminal, so use full paths and log the output.

Common options

OptionWhat it does
crontab -eEdit your table.
crontab -lList your table.
crontab -rRemove your table (careful).
crontab -u user -lAnother user (root).
crontab fileInstall from a file.
*/15 * * * *Every 15 minutes.
0 2 * * 1-52 AM on weekdays.
@rebootOnce at boot.
  1. List current jobs.
crontab -l

Output:

no crontab for arjun

Nothing scheduled yet.

  1. Add a nightly backup at 1:30 AM.
crontab -e
30 1 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1

Output:

crontab: installing new crontab

minute 30, hour 1, every day. Output and errors go to a log.

  1. Check it is saved.
crontab -l

Output:

30 1 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1

The line is in your table.

  1. Confirm cron ran it.
sudo grep backup.sh /var/log/cron | tail -1

Output:

Oct 26 01:30:01 web01 CROND[5512]: (arjun) CMD (/usr/local/bin/backup.sh ...)

Proof of the run on RHEL. On Ubuntu use journalctl -u cron.

  1. Back up the table before editing.
crontab -l > ~/cron.bak

If someone runs crontab -r, you can restore with crontab ~/cron.bak.

Practise this in the tasks below: Practice tasks

Real use: A newspaper in Budhwar Peth uses crontab to publish the e-paper PDF at 5 AM every day.

11. curl: Talk to web servers and APIs

curl in depth: test websites and APIs from the terminal

Is the site up? Which status code? Is the certificate valid? Does the API return the right JSON? curl answers all of these from the server itself, which is where you usually debug.

curl transfers data with URLs over HTTP, HTTPS, FTP and more. By default it prints the body. Options add headers, send JSON, follow redirects, show timings or save files.

Common options

OptionWhat it does
curl URLPrint the body.
curl -I URLHeaders only (HEAD).
curl -sSSilent but show errors.
curl -LFollow redirects.
curl -o file URLSave to a file.
curl -X POST -H "Content-Type: application/json" -d @b.jsonSend JSON.
curl -u user:passBasic auth.
curl -kSkip TLS checks (testing only).
curl -w "%{http_code}"Print chosen values.
curl --resolve host:443:IPTest a server before DNS change.
  1. Check headers.
curl -I https://example.com

Output:

HTTP/2 200
content-type: text/html; charset=UTF-8

200 means OK. The headers show the type and server details.

  1. Only the status code.
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/health

Output:

200

Perfect for scripts and health checks.

  1. Time each step.
curl -s -o /dev/null -w "dns=%{time_namelookup} connect=%{time_connect} total=%{time_total}\n" https://example.com

Output:

dns=0.004 connect=0.021 total=0.183

Shows where the slowness is: DNS, connect or server.

  1. Call a JSON API.
curl -sS -X POST -H "Content-Type: application/json" -d '{"sku":"A1","qty":2}' http://localhost:8080/api/orders

Output:

{"id":1042,"status":"created"}

The API created order 1042.

  1. Test the new server before switching DNS.
curl -sI --resolve shop.example.com:443:10.0.5.20 https://shop.example.com | head -1

Output:

HTTP/2 200

curl talks to 10.0.5.20 but uses the real name for TLS.

Practise this in the tasks below: Practice tasks

Real use: A food-delivery startup in Koregaon Park runs curl -w checks every minute to catch slow payment APIs.

12. cut: Cut columns or characters from lines

cut in depth: pick columns and characters

Very often you need only one field from each line, such as user names, IPs or a date. cut is the simplest tool for fixed separators.

cut picks fields (-f) using a one-character delimiter (-d, default tab), or characters (-c), or bytes (-b). It cannot handle many spaces in a row; use awk for that.

Common options

OptionWhat it does
cut -d: -f1Field 1, colon separator.
cut -d, -f2,4Fields 2 and 4.
cut -d, -f3-Field 3 to the end.
cut -c1-10Characters 1 to 10.
cut --complement -f2All fields except 2.
cut -d, -f1 --output-delimiter=" "Change the output separator.
  1. List user names.
cut -d: -f1 /etc/passwd | head -3

Output:

root
bin
daemon

Field 1 of each line.

  1. Name and home folder.
cut -d: -f1,6 /etc/passwd | tail -2

Output:

arjun:/home/arjun
priya:/home/priya

The output keeps the colon.

  1. Date part of log lines.
cut -c1-10 app.log | sort | uniq -c

Output:

  540 2026-10-25
  212 2026-10-26

Count log lines per day.

  1. Why cut fails on spaces.
echo 'a   b' | cut -d' ' -f2

Field 2 is empty because there are many spaces. awk '{print $2}' gives b.

Practise this in the tasks below: Practice tasks

Real use: An HR software team in Wakad cuts employee ids out of daily CSV attendance files with cut -d, -f1.

13. date: Show or format date and time

date in depth: show, format and calculate dates

Backups and logs need dated names. Reports need "yesterday". Incidents need UTC and IST side by side. date does all of this.

date prints the current date and time in the system time zone. A + format string controls the output. GNU date -d understands words like yesterday and next monday. TZ changes the zone for one command.

Common options

OptionWhat it does
dateNow.
date +%F2026-10-26 format.
date +%Y%m%d-%H%MFor file names.
date -uUTC.
date -d yesterday +%FYesterday.
date -d "+7 days"A week later.
date +%sSeconds since 1970 (epoch).
date -d @1761400000Epoch to normal date.
TZ=Asia/Kolkata dateTime in another zone.
  1. Plain date.
date

Output:

Mon Oct 26 01:20:05 IST 2026

Shown in the server zone.

  1. A dated backup name.
tar czf "db-$(date +%F).tgz" db/ && ls db-*

Output:

db-2026-10-26.tgz

Sorts nicely and is easy to read.

  1. Yesterday for a report.
date -d yesterday +%F

Output:

2026-10-25

No maths needed.

  1. UTC and IST together.
date -u +%T; TZ=Asia/Kolkata date +%T

Output:

19:50:05
01:20:05

IST is UTC plus 5:30.

  1. Turn an epoch from a log into a date.
date -d @1761400000

Output:

Sat Oct 25 19:16:40 IST 2025

Many apps log epoch seconds.

  1. Time a step in a script.
s=$(date +%s); sleep 2; echo $(( $(date +%s) - s ))s

Output:

2s

Subtract two epochs.

Practise this in the tasks below: Practice tasks

Real use: A logistics firm in Chakan names each day's shipment export with date +%F so the files sort by day.

14. dd: Copy raw data block by block

dd in depth: raw copies, test files and bootable USBs

Some jobs need a byte-for-byte copy: writing an ISO to a USB stick, cloning a disk, making a test file of exact size, or wiping the start of a disk. dd does that, but one wrong letter can destroy a disk, so learn it carefully.

dd copies from if= (input file) to of= (output file) in blocks of bs= size, count= times. It does not care about filesystems. status=progress shows progress. conv=fsync makes sure data reaches the disk.

Common options

OptionWhat it does
if=FILEInput.
of=FILEOutput (double-check this).
bs=4MBlock size.
count=NNumber of blocks.
status=progressShow progress.
conv=fsyncFlush to disk at the end.
oflag=directBypass cache (for speed tests).
skip=N / seek=NSkip input / output blocks.
  1. Make a 100 MB test file.
dd if=/dev/zero of=test.img bs=1M count=100 status=progress

Output:

104857600 bytes (105 MB, 100 MiB) copied, 0.12 s, 870 MB/s

100 blocks of 1 MiB each.

  1. Rough disk write speed.
dd if=/dev/zero of=/data/t bs=1M count=1024 oflag=direct

Output:

1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4.2 s, 256 MB/s

oflag=direct skips RAM cache, so the number is closer to the disk.

  1. Find the USB stick first.
lsblk -d -o NAME,SIZE,MODEL

Output:

sda  476G Samsung SSD
sdb   15G SanDisk Ultra

sdb is the 15 GB USB stick. Never guess.

  1. Write an ISO to it.
sudo dd if=Rocky-9.iso of=/dev/sdb bs=4M status=progress conv=fsync

Output:

2.1 GB copied, 140 s, 15 MB/s

Writes to the whole device, not a partition like sdb1.

  1. Back up the first MiB of a disk (partition table).
sudo dd if=/dev/vda of=vda-head.bin bs=1M count=1

Output:

1048576 bytes copied

A small safety copy before partition work.

Practise this in the tasks below: Practice tasks

Real use: A hardware shop in Narayan Peth writes Linux installer USBs for customers with dd, always checking lsblk first.

15. df: Show free disk space per filesystem

df in depth: free space, inodes and types

A full disk stops databases, logging and even SSH logins. df is the first thing to run when someone says "the server is slow" or "the app cannot write".

df shows each mounted filesystem with size, used, available, use percent and mount point. -h gives human units. -i shows inodes, which can run out even when space is free. -T adds the filesystem type.

Common options

OptionWhat it does
df -hHuman readable.
df -hTWith type.
df -iInodes.
df -h /varThe filesystem holding /var.
df -x tmpfs -x devtmpfsHide memory filesystems.
df --output=target,pcentChoose columns.
  1. The overview.
df -h

Output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1   20G   18G  2.0G  91% /
/dev/nvme1n1    100G   40G   60G  40% /data

Root is 91% full; act before it hits 100.

  1. Only real disks with type.
df -hT -x tmpfs -x devtmpfs

Output:

/dev/nvme0n1p1 xfs 20G 18G 2.0G 91% /

Memory filesystems are hidden.

  1. Inodes full?
df -i /var

Output:

Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vda3 655360 655360 0 100% /var

Space may be free, but no new file can be made. Usually millions of tiny files.

  1. Script-friendly use percent.
df --output=pcent / | tail -1 | tr -dc 0-9

Output:

91

Just the number, ready for an alert check.

Practise this in the tasks below: Practice tasks

Real use: A hospital PACS team in Erandwane watches df on the image store every hour, because a full disk stops X-ray uploads.

16. diff: Show differences between files

diff in depth: what changed between two files

After an upgrade or a colleague's change, you need to know exactly what changed in a config. diff shows it line by line and makes patches you can share.

diff compares two text files. The default format uses < and >. -u gives the unified format used by git and patch, with - for removed and + for added lines. -r compares folders. Exit code 0 means same, 1 means different.

Common options

OptionWhat it does
diff a bDefault format.
diff -u a bUnified format.
diff -y a bSide by side.
diff -r d1 d2Compare folders.
diff -q d1 d2Only say which files differ.
diff -w a bIgnore spaces.
diff -i a bIgnore case.
diff <(cmd1) <(cmd2)Compare command outputs.
  1. Unified diff of a config.
diff -u nginx.conf.bak /etc/nginx/nginx.conf

Output:

--- nginx.conf.bak
+++ /etc/nginx/nginx.conf
@@ -12 +12 @@
-    worker_connections 768;
+    worker_connections 4096;

One line changed: 768 became 4096.

  1. Side by side for quick reading.
diff -y --width=60 a.txt b.txt

Output:

port=80        |  port=8080
user=web          user=web

| marks a changed line.

  1. Which files differ in two releases?
diff -rq release-41/ release-42/

Output:

Files release-41/app.py and release-42/app.py differ
Only in release-42/: migrate.sql

Quick summary across folders.

  1. Compare two servers' configs.
diff <(ssh web01 cat /etc/app.conf) <(ssh web02 cat /etc/app.conf)

Output:

3c3
< threads=8
---
> threads=4

web02 runs fewer threads. That explains the slowness.

  1. Make and apply a patch.
diff -u old.conf new.conf > fix.patch && patch old.conf < fix.patch

Output:

patching file old.conf

old.conf now matches new.conf.

Practise this in the tasks below: Practice tasks

Real use: An insurance company in Yerawada uses diff -u in change tickets so reviewers see exactly which config lines change.

17. dig: Query DNS records

dig in depth: ask DNS exactly what you want

"It is always DNS" is a joke among admins because so many outages are DNS problems. dig shows exactly what a DNS server answers, which record, and for how long it will be cached.

dig (from bind-utils or dnsutils) sends DNS queries. You choose the name, the record type (A, AAAA, MX, CNAME, TXT, NS) and the server with @. +short trims the output; +trace follows the chain from the root servers.

Common options

OptionWhat it does
dig nameA record with full details.
dig +short nameOnly the answer.
dig name MXMail servers.
dig name TXTTXT records (SPF, verification).
dig @8.8.8.8 nameAsk a specific server.
dig -x IPReverse lookup.
dig +trace nameFollow from the root.
dig +noall +answer nameOnly the answer section.
  1. Quick answer.
dig +short example.com

Output:

93.184.215.14

The IP the name points to.

  1. See TTL.
dig +noall +answer example.com

Output:

example.com.  3600  IN  A  93.184.215.14

3600 seconds: resolvers cache this for up to one hour.

  1. Check mail servers.
dig +short gmail.com MX

Output:

5 gmail-smtp-in.l.google.com.
10 alt1.gmail-smtp-in.l.google.com.

Lower number = higher priority.

  1. Compare your DNS with public DNS.
dig +short shop.example.in; dig +short @1.1.1.1 shop.example.in

Output:

10.0.5.10
203.0.113.20

Internal DNS gives a private IP; public DNS gives the public one. Normal for split DNS.

  1. Reverse lookup.
dig +short -x 8.8.8.8

Output:

dns.google.

Which name owns an IP.

Practise this in the tasks below: Practice tasks

Real use: An e-commerce team in Hinjewadi checks dig against several resolvers right after moving its site to a new load balancer.

18. dirname: Get the folder part of a path

dirname in depth: the folder part of a path

Scripts often need the folder a file is in, for example to create it first or to find files next to the script.

dirname removes the last part of a path and prints the rest. If there is no slash it prints a dot. Like basename it works on text only. Bash can do ${p%/*}.

Common options

OptionWhat it does
dirname PATHFolder part.
dirname a/b c/dMany paths.
dirname -zUse NUL at the end.
"$(dirname "$0")"Folder of the running script.
${p%/*}Pure bash way.
  1. Simple.
dirname /var/log/nginx/access.log

Output:

/var/log/nginx

The file name is removed.

  1. No slash.
dirname notes.txt

Output:

.

Dot means the current folder.

  1. Find files next to your script.
cd "$(dirname "$0")" && ls

Output:

deploy.sh  config.env

The script works from anywhere.

  1. Create the parent before writing.
out=/srv/reports/2026/10/sales.csv; mkdir -p "$(dirname "$out")"

The folder tree exists before the file is saved.

Practise this in the tasks below: Practice tasks

Real use: A reporting script at a Pune pharma company uses dirname to make month folders before writing each report.

19. dmesg: Read kernel messages

dmesg in depth: kernel messages about disks, memory and hardware

When a disk fails, a USB device is added, the OOM killer kills a process or a network card resets, the kernel writes a message. dmesg is where you read it.

dmesg prints the kernel ring buffer. -T shows readable times, -l filters by level, -w waits for new messages. On many systems normal users need sudo. journalctl -k shows the same kernel log with persistence.

Common options

OptionWhat it does
dmesg -THuman times.
dmesg -l err,warnErrors and warnings.
dmesg -wFollow new messages.
dmesg -HPretty, paged output.
dmesg | grep -i oomFind OOM kills.
dmesg -cPrint then clear (root).
journalctl -k -b -1Kernel log of the last boot.
  1. Recent errors.
sudo dmesg -T -l err,warn | tail -3

Output:

[Mon Oct 26 00:12:01 2026] EXT4-fs warning (device nvme1n1): ext4_end_bio: I/O error 10

I/O errors often mean a failing disk.

  1. Why did my Java process die?
sudo dmesg -T | grep -i "killed process"

Output:

[Mon Oct 26 00:40:11 2026] Out of memory: Killed process 2211 (java) total-vm:8123456kB

The kernel OOM killer stopped it; the server ran out of RAM.

  1. Watch while you plug in a disk.
sudo dmesg -wT

Output:

[...] sd 2:0:0:0: [sdb] 31457280 512-byte logical blocks: (16.1 GB/15.0 GiB)

The new disk is sdb. Press Ctrl+C to stop.

Practise this in the tasks below: Practice tasks

Real use: A cloud support engineer in Magarpatta checks dmesg for OOM kills whenever a customer says "the app restarts by itself".

20. dnf: Install packages on RHEL, Fedora, Amazon Linux

dnf in depth: packages on RHEL, Rocky, Fedora and Amazon Linux 2023

Most enterprise Linux in Indian companies and banks is RHEL or a RHEL rebuild. You install software, patch CVEs, roll back bad updates and find which package gives a file, all with dnf.

dnf resolves dependencies and installs RPM packages from repositories in /etc/yum.repos.d/. It keeps a history you can undo. yum on RHEL 8 and 9 is a link to dnf.

Common options

OptionWhat it does
dnf install -y pkgInstall.
dnf remove pkgRemove.
dnf upgradeUpgrade all.
dnf check-updateWhat can be upgraded.
dnf updateinfo list --securitySecurity updates.
dnf search wordSearch.
dnf info pkgPackage details.
dnf provides /pathWhich package owns a file.
dnf historyPast transactions.
dnf history undo NUndo transaction N.
dnf repolistEnabled repositories.
dnf module listModule streams (RHEL 8/9).
  1. Which repos are on?
dnf repolist

Output:

repo id        repo name
appstream      Rocky Linux 9 - AppStream
baseos         Rocky Linux 9 - BaseOS

Two main RHEL-family repos.

  1. Install a web server.
sudo dnf install -y httpd

Output:

Installed:
  httpd-2.4.57-11.el9.x86_64 ...
Complete!

Dependencies came automatically.

  1. Find the package for a missing command.
dnf provides */bin/dig

Output:

bind-utils-32:9.16.23-18.el9.x86_64 : Utilities for querying DNS name servers

Install bind-utils to get dig.

  1. Security fixes only.
sudo dnf upgrade --security -y

Output:

Upgraded: openssl-1:3.0.7-27.el9 ...

Good for quick CVE patching.

  1. Undo a bad change.
sudo dnf history | head -4 && sudo dnf history undo 14 -y

Output:

ID | Command line | Date and time | Action(s)
14 | install httpd | 2026-10-26 01:30 | Install

Transaction 14 is reversed.

Practise this in the tasks below: Practice tasks

Real use: A bank data centre in Pune patches RHEL servers monthly with dnf upgrade --security and keeps dnf history ids in the change ticket for rollback.

21. du: Show how much space folders use

Find the affected mount with df first, then use du within that mount one directory level at a time. If a large folder inside this tree actually belongs to another filesystem, its size will distract you from the full one. du -x keeps the search within a single filesystem. After you remove a known lab file, repeat df on the same mount to confirm the space changed.

du in depth: what is eating the disk?

df tells you a disk is full. du tells you which folder is using the space, so you know what to clean or move.

du adds up the space used by files and folders. -s gives one total per argument, -h human units, -d sets depth, -x stays on one filesystem. Deleted but still open files are not counted, so df and du can disagree.

Common options

OptionWhat it does
du -sh dirTotal for dir.
du -h -d1 dirOne level deep.
du -xh -d1 /Stay on the root filesystem.
du -sh * | sort -hRank items by size.
du -ah dirInclude files.
du --exclude=*.isoSkip a pattern.
du -c a bGrand total.
  1. Total of a folder.
sudo du -sh /var/log

Output:

4.2G	/var/log

Logs are 4.2 GB.

  1. Biggest folders under /var.
sudo du -xh -d1 /var | sort -h | tail -4

Output:

310M	/var/cache
1.1G	/var/lib
4.2G	/var/log
5.7G	/var

/var/log is the big one.

  1. Dig one more level.
sudo du -sh /var/log/* | sort -h | tail -2

Output:

600M	/var/log/journal
3.4G	/var/log/app

The app logs need rotation.

  1. Largest files.
sudo find /var/log -type f -size +500M -exec du -h {} + | sort -h

Output:

2.9G	/var/log/app/debug.log

One debug log is 2.9 GB.

  1. df and du disagree?
sudo lsof +L1 | head -3

Output:

java 2211 app 12w REG 259,1 2147483648 0 1234 /var/log/app/old.log (deleted)

A deleted file is still held open; restart the process to free the space.

Practise this in the tasks below: Practice tasks

Real use: A video-streaming startup in Balewadi runs du -xh -d1 when its transcoding server fills up, then clears the temp chunks.

22. Commands in this range already covered in depth

These commands already have a full why, what and how section in an earlier chapter. Repeating them here would only make the page longer.

Each link opens the exact section with options, examples and output.

  • cp: Copy files and folders: -r, -i, -v and -p

23. Real examples from many industries

The same Linux skill shows up in every kind of company. Seeing it in many places helps you remember it.

Each row is a made-up team. It shows who uses this and how.

Team and cityHow they use itCommand
Aditya, broking, DeccanAlerts on clock offset over 100 mschronyc tracking
Swati, e-commerce, HinjewadiChecks DNS after a load balancer movedig +short @1.1.1.1 shop.example.in
Nikhil, payments, Koregaon ParkTimes payment API calls every minutecurl -s -o /dev/null -w "%{time_total}" URL
Rupali, bank DC, PuneMonthly RHEL patching with rollback idsdnf upgrade --security -y
Omkar, video startup, BalewadiFinds what fills the transcoding diskdu -xh -d1 / | sort -h
Neha, insurance, YerawadaPuts config diffs in change ticketsdiff -u old.conf new.conf

24. Common errors and how to fix them

Everyone hits these errors. Knowing the cause saves hours.

Read the exact message first. Then match it to a row below.

Error you seeWhy it happensHow to fix
506 Cannot talk to daemonchronyd is not runningStart the service.
systemctl enable --now chronyd
chroot: failed to run command '/bin/bash': No such file or directoryWrong folder or root disk not mountedMount the right partition first.
lsblk -f; ls /mnt/sys/bin/bash
comm: file 1 is not in sorted orderInput not sortedSort both inputs.
comm <(sort a) <(sort b)
Cron job runs by hand but not from cronCron has a small PATH and no envUse full paths and log output.
PATH=/usr/local/bin:/usr/bin:/bin
curl: (60) SSL certificate problem: unable to get local issuer certificateMissing CA bundle or a broken chain on the serverFix the chain; update CA certificates.
openssl s_client -connect host:443 -showcerts
curl: (7) Failed to connect to localhost port 8080: Connection refusedNothing is listening on that portStart the app or check the port.
ss -ltnp | grep 8080
cut: the delimiter must be a single characterUsed -d with two charactersUse one character or switch to awk.
awk -F'::' '{print $2}' f
date: invalid date 'yesterdy'Typing mistake in -d textFix the word.
date -d yesterday
dd: failed to open '/dev/sdb': Permission deniedNeeds rootUse sudo, after checking lsblk.
lsblk; sudo dd ...
No space left on device (but df shows free space)Inodes are fullFind folders with many tiny files.
df -i; du --inodes -d2 /var | sort -n | tail
;; connection timed out; no servers could be reachedDNS server unreachable or blockedCheck resolv.conf and port 53.
cat /etc/resolv.conf; nc -vzu 8.8.8.8 53
Error: Failed to download metadata for repo 'appstream'No internet, proxy or a bad mirrorCheck network, then clean cache.
dnf clean all; dnf makecache

25. Troubleshooting step by step

When a Part 2 command misbehaves, go through these steps.

Go top to bottom. Stop at the first step that shows the problem.

  1. Is the service behind it running (chronyd, crond)?
systemctl is-active chronyd crond
  1. Can you reach the network?
ping -c2 8.8.8.8
  1. Is DNS working?
dig +short example.com
  1. Is the disk or inode table full?
df -h /; df -i /
  1. Did the kernel log anything?
sudo dmesg -T | tail -5
  1. What changed recently?
sudo dnf history | head -5

26. Lab 1: Find and fix a full disk

Fill a test folder, find it with df and du, then clean it and schedule automatic cleanup.

A full hands-on lab. Run every step on a test Linux machine (an EC2 instance, a VM, or WSL).

  1. Create big test files.
mkdir -p /tmp/lab9 && for i in 1 2 3; do dd if=/dev/zero of=/tmp/lab9/f$i bs=1M count=200 status=none; done
  1. See the disk.
df -h /tmp

Output:

tmpfs 1.8G 600M 1.2G 33% /tmp
  1. Find the folder.
du -sh /tmp/* 2>/dev/null | sort -h | tail -1

Output:

600M	/tmp/lab9
  1. Delete old files.
find /tmp/lab9 -name "f*" -mmin +0 -delete; du -sh /tmp/lab9

Output:

0	/tmp/lab9
  1. Schedule nightly cleanup.
(crontab -l 2>/dev/null; echo "15 2 * * * find /tmp/lab9 -type f -mtime +1 -delete") | crontab -
  1. Confirm.
crontab -l | tail -1

Output:

15 2 * * * find /tmp/lab9 -type f -mtime +1 -delete

27. Lab 2: Check a website end to end

Check DNS, connection timing, status code and the TLS date of a site, and compare two server configs.

A full hands-on lab. Run every step on a test Linux machine (an EC2 instance, a VM, or WSL).

  1. DNS answer and TTL.
dig +noall +answer example.org

Output:

example.org. 3600 IN A 93.184.215.14
  1. Status code.
curl -s -o /dev/null -w "%{http_code}\n" https://example.org

Output:

200
  1. Timing.
curl -s -o /dev/null -w "dns=%{time_namelookup} tls=%{time_appconnect} total=%{time_total}\n" https://example.org

Output:

dns=0.003 tls=0.090 total=0.170
  1. Certificate end date.
echo | openssl s_client -connect example.org:443 2>/dev/null | openssl x509 -noout -enddate

Output:

notAfter=Jan 15 23:59:59 2027 GMT
  1. Make two configs.
printf 'port=80\nthreads=8\n' > a.conf; printf 'port=80\nthreads=4\n' > b.conf
  1. Compare.
diff -u a.conf b.conf

Output:

-threads=8
+threads=4

Ravindra Bagale's Tip

Make two habits today. One: before any risky change, save a copy and later compare it with diff -u. Two: whenever you add a cron line, send its output to a log file. These two habits alone will save you during most late-night incidents.

28. Frequently asked questions

Q. Why is df different from du?

du cannot see deleted files that are still open, and it skips other mounts with -x. Check lsof +L1.

Q. cron or systemd timer?

Both work. Timers give logs in journalctl and handle missed runs; cron is simpler and everywhere.

Q. Is curl -k safe?

Only for testing. It turns off certificate checks.

Q. dig or nslookup?

dig gives more detail and is preferred by admins. nslookup is in a later part.

Q. Can dd damage my laptop disk?

Yes, if of= points to it. Always check lsblk first.

Q. Is yum gone?

On RHEL 8 and 9, yum is just a link to dnf.

Q. Why does my cron job not see my variables?

Cron does not read your .bashrc. Set variables in the crontab or the script.

Q. Where is cp?

Linked above under commands already covered.

29. Interview questions and answers

Beginner level

Q. What do the five cron fields mean?

Minute, hour, day of month, month, day of week.

Q. How do you check free disk space?

df -h.

Q. How do you see only HTTP headers?

curl -I URL.

Q. How do you get yesterday's date?

date -d yesterday +%F.

Mid level level

Q. Disk is full but du shows little. Why?

A deleted file is still open; find it with lsof +L1 and restart the process.

Q. How do you check which DNS server answers?

dig name shows SERVER: at the bottom; dig @server name tests one.

Q. How do you undo a bad package update?

dnf history then dnf history undo ID.

Q. What does chronyc makestep do?

Steps the clock at once instead of slewing.

Senior level

Q. Root password lost on RHEL 9. Steps?

rd.break, mount -o remount,rw /sysroot, chroot /sysroot, passwd, touch /.autorelabel.

Q. How to test a new server before DNS cutover?

curl --resolve host:443:NEWIP https://host.

Q. Design a safe cron for backups across 200 servers.

Random delay, flock to prevent overlap, logs, alert on failure, and a central check.

Try at home

  1. Run the five-minute health check on your own VM and save the output with today's date in the name.
  2. Add a cron job that writes date to a file every 5 minutes; check it after 15 minutes, then remove it.
  3. Use dig on three sites you use daily and note their TTLs.

Practise this chapter

Interview questions and answers

Two hosts show different event times. How do you distinguish clock error from zone differences?

Compare their UTC displays and check time synchronization status and offset. A time zone changes how the same instant is shown, while an offset means the clocks disagree. Align the incident timestamp after checking both.

Check your understanding

Choose an answer, then compare your reasoning with the explanation.

0 of 3 answered correctly
1. What does an empty cmp result with exit status zero mean for two readable files?

Answer and explanation

C. Their bytes match

cmp is normally quiet for identical inputs. Its exit status tells you which outcome occurred.

2. Why use du -x in a full-mount investigation?

Answer and explanation

A. To keep the directory scan on one filesystem

Subdirectories can be separate mount points. Staying on one filesystem avoids counting unrelated allocations.

3. Which output is useful for checking synchronization against a time source?

Answer and explanation

A. chronyc tracking

Chrony’s tracking report identifies its reference and clock-state measurements.

Practice Tasks

Practice checks run in your browser. They check the answer for this exercise; they do not create resources or connect to your AWS account.

About this scenario

London Legal LLP is a law business in London. Oliver Hughes looks after its IT and cloud work. They count money in GBP and run their AWS resources in the eu-west-2 Region. In the tasks below you do real jobs for them using what this lesson teaches. All names, account IDs, IP addresses and numbers are made up for practice.

0 / 20

Easy Numeric sources

BIZ runs Linux servers and uses commands from chronyc to du daily.

List chrony source statistics without DNS lookups.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Easy Numeric tracking

BIZ runs Linux servers and uses commands from chronyc to du daily.

Show chrony tracking with numeric addresses only.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Easy Save a file

BIZ runs Linux servers and uses commands from chronyc to du daily.

Download https://example.com/a.tar.gz keeping its remote file name, following redirects.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Easy Next Monday

BIZ runs Linux servers and uses commands from chronyc to du daily.

Print the date of next monday as YYYY-MM-DD.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Easy Warnings only

BIZ runs Linux servers and uses commands from chronyc to du daily.

Show kernel messages of level warn only with readable times.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium First bytes only

BIZ runs Linux servers and uses commands from chronyc to du daily.

Compare only the first 512 bytes of disk1.img and disk2.img.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium Only in second

BIZ runs Linux servers and uses commands from chronyc to du daily.

Show lines only in new.txt when compared with old.txt (both sorted).

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium Another user's cron

BIZ runs Linux servers and uses commands from chronyc to du daily.

As root, list the crontab of user deploy.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium Basic auth

BIZ runs Linux servers and uses commands from chronyc to du daily.

Call http://localhost:9000/api/health with user admin and password Pune123 showing headers only.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium All but one field

BIZ runs Linux servers and uses commands from chronyc to du daily.

Print all comma fields of emp.csv except field 3.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium UTC ISO time

BIZ runs Linux servers and uses commands from chronyc to du daily.

Print the current time in UTC in ISO 8601 with seconds.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium Choose df columns

BIZ runs Linux servers and uses commands from chronyc to du daily.

Show only source, size and available columns for /home in human units.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium Ignore spacing

BIZ runs Linux servers and uses commands from chronyc to du daily.

Compare a.yml and b.yml ignoring all white space, unified format.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Medium Name servers

BIZ runs Linux servers and uses commands from chronyc to du daily.

List only the name servers of example.org.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Hard Run one command inside

BIZ runs Linux servers and uses commands from chronyc to du daily.

Run passwd for user root inside /mnt/sys without opening a shell.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Hard JSON table

BIZ runs Linux servers and uses commands from chronyc to du daily.

Turn space-separated users.txt into JSON with column names name and uid.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Hard Weekend schedule

BIZ runs Linux servers and uses commands from chronyc to du daily.

Write the cron time fields for 6:45 AM on Saturday and Sunday only.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Hard Skip blocks

BIZ runs Linux servers and uses commands from chronyc to du daily.

Copy 1 MiB from disk.img starting after the first 10 MiB into part.bin.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Hard Info on one transaction

BIZ runs Linux servers and uses commands from chronyc to du daily.

Show the details of dnf transaction 22.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

Hard Inode hogs

BIZ runs Linux servers and uses commands from chronyc to du daily.

Show inode counts per folder one level under /var.

  1. Find the Linux command that does this job.
  2. Add the options (like -r or -h) the task needs.
  3. Add the file names, folders or users in the right order.
  4. Use sudo if the job changes system files or users. Click Check answer.

In short

  1. chronyc and date: time.
  2. cmp, comm, diff, cksum: compare.
  3. crontab: five fields, full paths, log output.
  4. curl and dig: web and DNS checks.
  5. df vs du: free space vs who uses it.
  6. dnf history undo rolls back.

Revision, comparison and interview cards

Revise this lesson in a few minutes. Save the cards on your phone or download them as PNG files. The QR code on each card opens this lesson.

Disk full?. Which filesystem. Inodes too. Biggest folders. Kernel errors.
Revision card: Disk full? · Download PNG · Open card page
Check a web service. DNS answer. HTTP status. Timing. Clock in sync.
Revision card: Check a web service · Download PNG · Open card page
df vs du. Filesystem view. / File and folder view.
Comparison: df vs du · Download PNG · Open card page
diff vs cmp. Line by line. / Byte by byte.
Comparison: diff vs cmp · Download PNG · Open card page
df full but du small?. Deleted file still open. Find it. Restart that service.
Interview card: df full but du small? · Download PNG · Open card page
Why is dd dangerous?. It writes raw blocks. Wrong of= wipes a disk. Check first.
Interview card: Why is dd dangerous? · Download PNG · Open card page
Cron job did not run?. Cron has a tiny PATH. Use full paths and log. Check the log.
Interview card: Cron job did not run? · Download PNG · Open card page
Test an API from a server?. Show headers. Fail on HTTP errors. Send JSON.
Interview card: Test an API from a server? · Download PNG · Open card page

More cards: Ravi Sir's Cards.