awk

CLI

Pattern-scanning and text-processing language.

Column-based text processing and pattern matching

4 curated recipes · not yet executed by the harness#text#columns#pattern#processing

Recipes

Curated from documentation and usage. Percentages are estimates, not measurements.

Print specific column from output

~99% est.
command | awk '{print $2}'

Sum a column of numbers

~97% est.
awk '{sum+=$1} END {print sum}' file.txt

Filter rows by condition

~97% est.
awk '$3 > 100' data.txt

Parse CSV and print column

~96% est.
awk -F',' '{print $2}' data.csv

Install

aptsudo apt install gawk

Agent notes

When to use
Extracting columns, computing sums, reformatting tabular text
Quick examples
  • awk '{print $1}' file.txt
  • awk -F',' '{sum+=$2} END {print sum}' data.csv

Use from an agent

curl -s https://clihub.com/api/tools/awk | jq '.agentHints.provenRecipes[] | {task, command, verified}'

Or call get_tool with slug awk on the MCP server at https://clihub.com/mcp.

GPL-3.00 views