Skip to content
Opsfolk

Linux and the terminal, topic 7 of 78

Text manipulation

Logs, configuration and command output are text, and most of operations is finding something in it. grep finds lines, sed edits them, awk picks columns and adds them up, sort, uniq and wc count, and jq does the same for JSON, which every API and cloud CLI returns.

A one-liner such as grep ' 500 ' access.log | awk '{print $1}' | sort | uniq -c | sort -rn answers a real question in seconds.

On Opsfolk

Nothing of ours for this topic yet: an article is on its way.

Elsewhere

Your progress