Hosting Operations
Read-only, can be slowTail the Failing CI Lines
A build log is thousands of lines long and the useful error is buried near the end.
Command
grep -RInE 'error|failed|exception|traceback|fatal' logs/ | tail -50
Before you run this
System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.
When not to use it: Do not use it as your only parser when the log format has structured fields better queried with jq or a log system.
Expected output
A short list of matching log lines with filenames, line numbers, and error text.
System impact
Read-only, can be slow. Nothing changes. The command reads log files and prints matching lines.
Scope this to the smallest useful path or service on busy systems.
Recovery / rollback: no state is changed.
When to use it
Use when triaging build, test, or deployment logs locally.
When not to use it
Do not use it as your only parser when the log format has structured fields better queried with jq or a log system.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ sed -n '1,20p' logs/build.log
INFO setup complete
error test failed in checkout.spec.ts
fatal deploy stopped before release switch
Traceback: deploy.py line 42
$ grep -RInE 'error|failed|exception|traceback|fatal' logs/ | tail -50
logs/build.log:2:error test failed in checkout.spec.ts
logs/build.log:3:fatal deploy stopped before release switch
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
sed -n '1,20p' logs/build.loggrep -RInE 'error|failed|exception|traceback|fatal' logs/ | tail -50
next steps
Related commands
Scan Every CI Log for Error Lines
One grep pass can turn a log pile into a failure list.
grep -RInE 'error|failed|failure|exception|traceback' artifacts logs | head -50
Count Request IDs in Error Lines
Repeated request IDs can connect separate error lines to one failing path.
grep -Ei 'error|timeout|fatal|exception' fixtures/incidents/app.log | awk '{for (i=1;i<=NF;i++) if ($i ~ /^request_id=/) print $i}' | sort | uniq -c | sort -nr
Find Tests That Passed After Rerun
A green retry can still hide a flaky test.
grep -RInE 'rerun|retry|flaky|passed on retry|failed attempt' artifacts logs
Find Coverage Regression Lines
Coverage failures usually say the threshold out loud.
grep -RInE 'coverage|threshold|minimum|below' artifacts logs
Count App Errors by Minute
A minute-by-minute count shows whether an incident is a spike or a drip.
awk 'tolower($0) ~ /(error|fatal|timeout|exception)/ {minute=substr($1,1,16); count[minute]++} END {for (m in count) print count[m], m}' fixtures/incidents/app.log | sort -nr
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.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.