Terminal Operations — Read, Search, Edit, Add, Verify
Man Page References
Every command below traces to a manual section. Use these to go deeper.
| Tool | Key Section | Command |
|---|---|---|
|
Pattern matching, |
|
|
|
|
|
Pattern ranges ( |
|
|
In-place |
|
|
|
|
|
Unified format, process substitution input |
|
|
|
|
|
|
|
|
|
|
|
Split stdout to file + terminal simultaneously |
|
man bash → EXPANSION1. Brace expansion {a,b,c} man bash → Brace Expansion
2. Tilde expansion ~ man bash → Tilde Expansion
3. Parameter expansion ${var} man bash → Parameter Expansion
4. Command substitution $(cmd) man bash → Command Substitution
5. Arithmetic expansion $(( )) man bash → Arithmetic Expansion
6. Process substitution <(cmd) man bash → Process Substitution
7. Word splitting unquoted $var man bash → Word Splitting
8. Filename expansion *.adoc man bash → Pathname Expansion
Navigation — Where Things Live
pages/ → container shells (include directives only) partials/ → actual content (this is what you edit) examples/ → code snippets (include::example$) nav.adoc → navigation tree antora.yml → attributes (single source of truth) partial$ = docs/modules/ROOT/partials/ example$ = docs/modules/ROOT/examples/
# include::partial$projects/murus-portae/summary.adoc[]
# becomes:
bat docs/modules/ROOT/partials/projects/murus-portae/summary.adoc
man grep → -o only-matching, -P PCRE, \K reset match startPAGE="docs/modules/ROOT/pages/projects/personal/domus-asciidoc-build/index.adoc"
grep -oP 'include::partial\$\K[^\[]+' "$PAGE" | \
while read -r inc; do
f="docs/modules/ROOT/partials/${inc}"
[ -f "$f" ] && printf "─── %s ───\n" "$inc" && cat "$f" && echo ""
done
─── projects/domus-asciidoc-build/summary.adoc ─── ─── projects/domus-asciidoc-build/purpose.adoc ─── ─── projects/domus-asciidoc-build/metadata.adoc ───
grep -rl 'partial\$projects/murus-portae/' docs/modules/ROOT/pages/
# Level 1: what does the page include?
grep 'include::' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc
# Level 2: what does that partial include?
grep 'include::' docs/modules/ROOT/partials/worklog/urgent.adoc
# Level 3: deeper
grep 'include::' docs/modules/ROOT/partials/worklog/urgent/professional.adoc
Worklog Patterns — Date-Driven Access
Path structure: pages/YYYY/MM/WRKLOG-YYYY-MM-DD.adoc — date components are shell-addressable.
Single Worklog
man bash → Command Substitutionbat docs/modules/ROOT/pages/2026/$(date +%m)/WRKLOG-$(date +%Y-%m-%d).adoc
bat docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-17.adoc
man awk → PATTERNSawk '/^=+ /' docs/modules/ROOT/pages/2026/$(date +%m)/WRKLOG-$(date +%Y-%m-%d).adoc
man awk → pattern range /start/,/end/awk '/^=== Carryover/,/^include::/' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc
man grep → REGULAR EXPRESSIONSgrep '\[ \]' docs/modules/ROOT/pages/2026/$(date +%m)/WRKLOG-$(date +%Y-%m-%d).adoc
man awk → variables, END blockawk '/\[ \]/{o++} /\[x\]/{d++} END{printf "Open: %d Done: %d\n",o,d}' \
docs/modules/ROOT/pages/2026/$(date +%m)/WRKLOG-$(date +%Y-%m-%d).adoc
Multiple Worklogs — Brace Expansion
man bash → Brace Expansionbat docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-{17,18,19,20,21}.adoc
for f in docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-{17,18,19,20,21}.adoc; do
printf "\n═══ %s ═══\n" "${f##*/}"
awk '/^=+ /' "$f"
done
grep -c '\[ \]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-{17,18,19,20,21}.adoc
docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-17.adoc:34 docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-18.adoc:27 docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-19.adoc:18 docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-20.adoc:30 docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc:43
Worklog Search — Glob Expansion
man bash → Pathname Expansionls -1 docs/modules/ROOT/pages/2026/04/WRKLOG-*.adoc
man grep → -r recursive, -l files-onlygrep -l 'murus-portae' docs/modules/ROOT/pages/2026/04/WRKLOG-*.adoc
grep -l 'MSCHAPv2' docs/modules/ROOT/pages/2026/04/WRKLOG-*.adoc
grep -rl 'mandiant' docs/modules/ROOT/pages/2026/*/WRKLOG-*.adoc
Worklog Diffs — Process Substitution
man bash → Process Substitution, man diffdiff <(grep '\[ \]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-20.adoc | sort) \
<(grep '\[ \]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc | sort)
diff <(grep '\[x\]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-20.adoc | sort) \
<(grep '\[x\]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc | sort) | grep '^>'
Substitutions Used in Worklog Patterns
| Pattern | Substitution Type | man bash Section |
|---|---|---|
|
Command substitution |
Command Substitution |
|
Brace expansion |
Brace Expansion |
|
Filename/glob expansion |
Pathname Expansion |
|
Parameter expansion (strip path) |
Parameter Expansion |
|
Process substitution |
Process Substitution |
Finding Things in Your Own Codex
When you know the topic but not the file.
man find → -type f, -namefind docs/modules/ROOT/partials/codex/bash -type f -name '*test*'
man awk → FNR (resets per file)awk 'FNR==1' docs/modules/ROOT/partials/codex/bash/*.adoc
man grep → -rli (recursive, files-only, case-insensitive)grep -rli 'conditional' docs/modules/ROOT/partials/codex/bash/
grep -rl 'strace' docs/modules/ROOT/partials/codex/
man find → -maxdepth 1find docs/modules/ROOT/partials/codex -maxdepth 1 -type d
man awk → FNR, /^=+ /for f in docs/modules/ROOT/partials/codex/bash/*.adoc; do
printf "\n═══ %s ═══\n" "${f##*/}"
awk '/^=+ /' "$f"
done
Read Operations
Single File
bat docs/modules/ROOT/partials/projects/murus-portae/summary.adoc
cat -n docs/modules/ROOT/partials/projects/murus-portae/appendix-todos.adoc
awk 'NR>=10 && NR<=25' docs/modules/ROOT/partials/projects/murus-portae/summary.adoc
man awk → PATTERNSawk '/^=+ /' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc
= WRKLOG-2026-04-21 == Summary == Session Accomplishments (Claude Code) === Worklog Catch-Up === PRJ-domus-asciidoc-build — Restructured to STD-001 == Today's Priorities === P0 — Must Do Today ==== CAB Presentation — 15:00 ==== MSCHAPv2 — Schedule Wednesday Meeting ==== SIEM Migration — Report Ready ==== Mandiant Remediation ==== ISE Security === P0 — Active (No Fixed Deadline) === P1 — Important === Administrative === Active Project Portfolio (d001 — 14 projects) === Infrastructure — Open === Personal — Carried
Bulk Read
for f in docs/modules/ROOT/partials/projects/*/summary.adoc; do
slug="${f%/*}"; slug="${slug##*/}"
printf "\n═══ %s ═══\n" "$slug"
cat "$f"
done | less
for f in docs/modules/ROOT/partials/projects/*/appendix-todos.adoc; do
slug="${f%/*}"; slug="${slug##*/}"
printf "\n═══ %s ═══\n" "$slug"
cat "$f"
done | less
Table Extraction
man awk → pattern {action} and toggle variableawk '/^\|===/{p=!p; next} p' docs/modules/ROOT/partials/projects/murus-portae/metadata.adoc
| Field | Value
| PRJ ID | PRJ-2026-04-murus-portae
| Author | {author}
| Created | 2026-04-15
| Updated | 2026-04-16
| Status | Active — discovery phase
| Category | Network Security / Application Security
| Priority | P0 (management request)
| Scope | Layer 7 WAF readiness assessment and implementation
| Platforms | Citrix NetScaler (reverse proxy), Cisco FTD/FMC (perimeter firewall)
| Related | PRJ-2026-04-firewall-audit, PRJ-2026-04-dmz-migration
awk '/^== Status/{p=1} p && /^== / && !/Status/{exit}' docs/modules/ROOT/partials/projects/domus-asciidoc-build/status.adoc
Search Operations
By Content
grep -rli 'mandiant' docs/modules/ROOT/
grep -rn -C3 'BLOCKED' docs/modules/ROOT/partials/projects/*/summary.adoc
grep -rPl '[0-9A-F]{2}(:[0-9A-F]{2}){5}' docs/modules/ROOT/
grep -rPn '(?<!\{)\b10\.50\.\d+\.\d+\b(?!\})' docs/modules/ROOT/partials/
grep -oP 'xref:[^\[]+' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc
man grep → -h suppress filename, -o only-matching, -P PCREgrep -rhoP '(Active|BLOCKED|Behind|Draft|Operational|Planned)' docs/modules/ROOT/partials/projects/*/summary.adoc | sort | uniq -c | sort -rn
54 Active
8 Planned
4 Operational
1 Draft
1 BLOCKED
By File
man find → TESTS → -name, -typefind docs/modules/ROOT -type f -name '*murus*'
find docs/modules/ROOT/partials/projects -type f -name 'summary.adoc'
man find → TESTS → -mtimefind docs/modules/ROOT -type f -name '*.adoc' -mtime 0
-mtime -3 means "less than 3 days ago"find docs/modules/ROOT -type f -name '*.adoc' -mtime -3
man find → -sizefind docs/modules/ROOT -type f -name '*.adoc' -size +50k -exec ls -lh {} \;
man find → -exec with sh -c# Uses parameter expansion ${1%.age} to strip .age suffix
# man bash → Parameter Expansion → ${parameter%word}
find data/ -name '*.adoc.age' -exec sh -c 'plain="${1%.age}"; [ -f "$plain" ] && echo "PLAINTEXT: $plain"' _ {} \;
Edit Operations
Field Updates (sed)
# Before
awk '/:revdate:/' docs/modules/ROOT/pages/projects/personal/domus-asciidoc-build/index.adoc
# Change
sed -i 's/:revdate: 2026-04-19/:revdate: 2026-04-21/' docs/modules/ROOT/pages/projects/personal/domus-asciidoc-build/index.adoc
# After
awk '/:revdate:/' docs/modules/ROOT/pages/projects/personal/domus-asciidoc-build/index.adoc
sed -i 's/| Active/| Operational/' docs/modules/ROOT/partials/projects/domus-asciidoc-build/metadata.adoc
awk '/Last Updated/{sub(/2026-04-19/, "2026-04-21")}1' \
docs/modules/ROOT/partials/projects/domus-asciidoc-build/metadata.adoc > /tmp/m && \
mv /tmp/m docs/modules/ROOT/partials/projects/domus-asciidoc-build/metadata.adoc
man sed → ADDRESSES (line number), man grep → -n line numbers# Find the line number first
grep -n 'Schedule recurring Wednesday' docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
# Mark it done (replace [ ] with [x] on that specific line)
sed -i '19s/\[ \]/[x]/' docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
# Verify
awk 'NR==19' docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
Bulk Edits
find docs/modules/ROOT/partials/projects -name 'metadata.adoc' -exec \
sed -i 's/Next Review: 2026-04-08/Next Review: 2026-05-08/' {} \;
grep -rl '{old-attribute}' docs/modules/ROOT/ | xargs sed -i 's/{old-attribute}/{new-attribute}/g'
Add Operations
Append to Existing Files
sed -i '/^|===$/ i\
| P2\
| New task description here\
| Pending' docs/modules/ROOT/partials/projects/domus-asciidoc-build/appendix-todos.adoc
sed -i '/^== Related/i include::partial$projects/domus-asciidoc-build/appendix-lessons.adoc[]\n' \
docs/modules/ROOT/pages/projects/personal/domus-asciidoc-build/index.adoc
sed -i '/^=== P1/i * [ ] **P0** - New urgent item description' \
docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
Create New Files
cat > docs/modules/ROOT/partials/projects/domus-asciidoc-build/appendix-lessons.adoc << 'EOF'
// Partial: Lessons for domus-asciidoc-build
== Lessons Learned
* Antora `partial$` resolves to module-relative paths
* `border-separate` gives carved grid tables across all CSS variants
* Theme as parameter (`--theme`) not hardcoded = reusable
EOF
SLUG="domus-asciidoc-build"
TITLE="Lessons Learned"
NAVTITLE="Lessons"
TARGET="docs/modules/ROOT/pages/projects/personal/${SLUG}/appendix-lessons.adoc"
cat > "$TARGET" << EOF
= ${TITLE}
:description: ${SLUG} lessons learned
:navtitle: ${NAVTITLE}
:icons: font
include++::++partial$projects/${SLUG}/appendix-lessons.adoc[]
EOF
SLUG="bibliotheca"
CATEGORY="personal"
TITLE="Domus Library System"
PRJ_ID="PRJ-2026-04-bibliotheca"
BASE_PARTIAL="docs/modules/ROOT/partials/projects/${SLUG}"
BASE_PAGE="docs/modules/ROOT/pages/projects/${CATEGORY}/${SLUG}"
mkdir -p "$BASE_PARTIAL" "$BASE_PAGE"
# metadata.adoc
cat > "${BASE_PARTIAL}/metadata.adoc" << EOF
// Partial: Metadata for ${SLUG}
== Metadata
[cols="1,2"]
|===
| Field | Value
| PRJ ID | ${PRJ_ID}
| Author | {author}
| Created | $(date +%Y-%m-%d)
| Last Updated | $(date +%Y-%m-%d)
| Status | Active
| Next Review | $(date -d '+30 days' +%Y-%m-%d)
|===
EOF
# summary.adoc
cat > "${BASE_PARTIAL}/summary.adoc" << EOF
// Partial: Summary for ${SLUG}
== Summary
${TITLE} — overview here.
EOF
# appendix-todos.adoc
cat > "${BASE_PARTIAL}/appendix-todos.adoc" << 'EOF'
// Partial: TODOs
== TODOs
[cols="1,3,1"]
|===
| Priority | Task | Status
| P1
| Initial task
| Pending
|===
EOF
# appendix-issues.adoc
cat > "${BASE_PARTIAL}/appendix-issues.adoc" << 'EOF'
// Partial: Known Issues
== Known Issues
No known issues.
EOF
# index.adoc (container page)
cat > "${BASE_PAGE}/index.adoc" << EOF
= ${TITLE}
:description: ${TITLE}
:navtitle: Overview
:icons: font
include++::++partial$projects/${SLUG}/summary.adoc[]
include++::++partial$projects/${SLUG}/metadata.adoc[]
EOF
# appendix pages
for appendix in appendix-todos appendix-issues; do
cat > "${BASE_PAGE}/${appendix}.adoc" << EOF
= ${appendix##appendix-}
:description: ${SLUG} ${appendix##appendix-}
:navtitle: ${appendix##appendix-}
:icons: font
include++::++partial$projects/${SLUG}/${appendix}.adoc[]
EOF
done
echo "Scaffolded: ${SLUG}"
ls -1 "${BASE_PARTIAL}/" "${BASE_PAGE}/"
Verify Operations
# Before
awk '/Status/' docs/modules/ROOT/partials/projects/domus-asciidoc-build/metadata.adoc
# Change
sed -i 's/| Active/| Operational/' docs/modules/ROOT/partials/projects/domus-asciidoc-build/metadata.adoc
# After
awk '/Status/' docs/modules/ROOT/partials/projects/domus-asciidoc-build/metadata.adoc
grep -Pn '\b10\.50\.\d+\.\d+\b' docs/modules/ROOT/partials/projects/domus-asciidoc-build/*.adoc
grep -rn ':toc:' docs/modules/ROOT/pages/projects/personal/domus-asciidoc-build/
make 2>&1 | grep -E "WARN|ERROR"
Analytics — Dashboards from the Terminal
man bash → Parameter Expansion ${var%/} ${var##/}, man grep → -P lookbehind# ${d%/*} = strip shortest suffix matching /* (removes filename)
# ${slug##*/} = strip longest prefix matching */ (removes path, keeps slug)
# grep -oP '(?<=...)' = PCRE lookbehind — match text AFTER "Status | "
for d in docs/modules/ROOT/partials/projects/*/summary.adoc; do
slug="${d%/*}"; slug="${slug##*/}"
status=$(grep -oP '(?<=Status\s*\|\s).*' "$d" 2>/dev/null | head -1)
printf "%-35s %s\n" "$slug" "${status:-unknown}"
done | sort -k2
for f in docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-{17,18,19,20,21}.adoc; do
count=$(grep -c '\[ \]' "$f" 2>/dev/null || echo 0)
printf "%s %3d open %s\n" "${f##*/}" "$count" "$(printf '█%.0s' $(seq 1 $((count/3))))"
done
diff <(grep '\[ \]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-20.adoc | sort) \
<(grep '\[ \]' docs/modules/ROOT/pages/2026/04/WRKLOG-2026-04-21.adoc | sort) | grep '^>'
for day in {07..21}; do
date="2026-04-${day}"
count=$(grep -c "^${date}" data/d000/infra/cross-repo-activity-2026-04-07-to-2026-04-21.adoc 2>/dev/null || echo 0)
printf "%s %3d %s\n" "$date" "$count" "$(printf '█%.0s' $(seq 1 $((count/2))))"
done
awk '/platform ownership/,/Enterprise Linux/' docs/modules/ROOT/partials/trackers/work/priorities/current.adoc
grep -oP '(Tony|Mark|Argam|Drew|Andrew|Jason|Victor|Justin|Arin|David|Shahab|Ding)\s*\w*' \
docs/modules/ROOT/partials/trackers/work/priorities/current.adoc | sort -u