テキスト処理(sed・awk・jq) - Linux

最終更新日: 2026-08-29

TOP(About this memo)) > 一覧(Linux) > テキスト処理(sed・awk・jq)

jq

echo '{"errors":[{"message":"The user credentials were incorrect.","extensions":{"category":"authentication"},"locations":[{"line":2,"column":3}],"path":["login"]}]}' | jq
cat response.json | jq '.errors[0].message'

sed

置換

削除

行の追加

その他

awk

ps aux | awk '{print $2}'
ps alx | awk '{printf ("%d\t%s\n", $8, $13)}' | sort -nr | head -10