Back to commands

Linux Survival Basics

Read-only

Show the Real User Cron Jobs

You need to inspect a user's scheduled cron commands without editing the crontab.

Command

crontab -l | sed -n '/^[[:space:]]*#/d;/^[[:space:]]*$/d;p'

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not use it as a full system scheduler audit; cron.d, cron.daily, and systemd timers live elsewhere.

Expected output

Active, non-comment user cron lines plus environment assignments. No output means this user may not own the job.

System impact

Read-only. Nothing changes. The command prints the active, non-comment crontab lines.

Recovery / rollback: no state is changed.

When to use it

Use when a job ran unexpectedly or did not run and you need the user's cron schedule first.

When not to use it

Do not use it as a full system scheduler audit; cron.d, cron.daily, and systemd timers live elsewhere.

Cron user and environment

Cron runs with a smaller environment than your shell. Confirm the job belongs to the expected user and uses absolute paths or explicit PATH.

  1. crontab -l
  2. sudo crontab -u app -l

next steps

Related commands

Linux Survival Basics Read-only

Show HTTPS Certificate with curl

curl can show the certificate path a client actually sees.

curl -Iv https://example.com/ 2>&1 | sed -n "/SSL connection/,/expire date/p"
Linux Survival Basics Read-only

Turn Cron Into a Readable Table

Cron is easier to debug when the schedule and command stop blending together.

crontab -l | awk 'NF && $1 !~ /^#/ {printf "%-16s %s\n", $1" "$2" "$3" "$4" "$5, substr($0,index($0,$6))}'
Linux Survival Basics Can be slow

Count Source Files by Extension

A quick extension count can show whether expected content made it into the source tree.

find source -type f -printf '%f\n' | sed -n 's/.*\.//p' | sort | uniq -c | sort -nr
Linux Survival Basics Can be slow

List URLs from a Sitemap

Before comparing sitemap coverage, print the URLs plainly.

grep -o '<loc>[^<]*</loc>' public/sitemap.xml | sed 's#<loc>##;s#</loc>##'

next diagnostic step

Where to go from this command

Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.