Signal9Signal9 — home
online
back to labs

Tame Your History: Big, Deduped, Durable, Timestamped

MediumCommand Line Guru15-25 min
The brief

A bare shell is hostile to productivity: it keeps a tiny history, records every duplicate command, OVERWRITES the history file on every exit (so two terminals clobber each other), and stamps nothing with a time. Fix all of it in a drop-in.

Write /root/.bashrc.d/productivity.sh so that, when sourced, the shell has: a large history (HISTSIZE and HISTFILESIZE both at least the value in /root/case/brief.txt), duplicate suppression (HISTCONTROL), append-don't-clobber (shopt -s histappend), and timestamps (HISTTIMEFORMAT). Grading sources your file in a clean shell and inspects the result, so any correct syntax counts — but don't wrap it in an interactive-only guard. See /root/case/brief.txt.

What you'll do
  • Raise HISTSIZE and HISTFILESIZE to the required floor
  • Drop duplicate commands with HISTCONTROL
  • Turn on histappend so shells append instead of overwriting the history file
  • Add timestamps with HISTTIMEFORMAT

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.