Linux Text Processing Cheat Sheet/Read from standard input

Many text tools consume stdin naturally.

Section: Overview and Core Patterns

Read from standard input

bash
bash
journalctl -u nginx | awk '{print $1, $2, $3}'
Explanation

Most Linux text tools are designed for stream processing and work especially well in pipelines.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Overview and Core Patterns
Pipe file content into grep
Basic pipeline for filtering text from a file.
OpenIn sheetbashsame section
Save output and continue pipeline
Write output to a file while still passing it downstream.
OpenIn sheetbashsame section
Split a long pipeline across lines
Use backslashes for readability.
OpenIn sheetbashsame section
Search a file directly
Prefer direct file arguments when possible.
OpenIn sheetbashsame section
Print line range with awk
Alternative line-range extraction using NR.
OpenIn sheetbash1 tag match
Show first 20 lines
Preview the top of a file.