Back to commands

Hosting Operations

Read-only, can be slow

Summarize Test Counts from Reports

You need to know whether one test failed, many tests failed, or the whole suite crashed.

Command

grep -RhoE 'tests="[0-9]+"|failures="[0-9]+"|errors="[0-9]+"|skipped="[0-9]+"' artifacts/test/*.xml | sort | uniq -c

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 this for exact aggregation across nested XML suites without a real parser.

Expected output

Counts of test, failure, error, and skipped attributes.

System impact

Read-only, can be slow. Nothing changes. The shell prints repeated test count attributes.

Scope this to the smallest useful path or service on busy systems.

Recovery / rollback: no state is changed.

When to use it

Use before diving into individual failures to understand test-suite scope.

When not to use it

Do not use this for exact aggregation across nested XML suites without a real parser.

next steps

Related commands

Hosting Operations Can be slow

List Failed Tests from JUnit XML

The XML report already knows which tests failed.

grep -RIn '<failure\|<error' artifacts/test/*.xml
Hosting Operations Can be slow

Count Request IDs in Error Lines

Repeated request IDs can connect separate error lines to one failing path.

grep -Ei 'error|timeout|fatal|exception' /var/log/app/app.log | awk '{for (i=1;i<=NF;i++) if ($i ~ /^request_id=/) print $i}' | sort | uniq -c | sort -nr
Hosting Operations Can be slow

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
Hosting Operations Can be slow

Find Duplicate Page Titles

Duplicate titles make a static site harder to scan in search results and browser tabs.

grep -Rho --include='*.html' '<title>[^<]*</title>' public | sed 's#<title>##;s#</title>##' | sort | uniq -c | sort -nr
Hosting Operations Can be slow

Summarize Cache File Ages

Cache cleanup is safer when you know whether files are stale or still active.

find /var/cache -xdev -type f -printf '%TY-%Tm-%Td\n' 2>/dev/null | sort | uniq -c
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.