Skip to content

Instantly share code, notes, and snippets.

@momotaro98
Created June 19, 2020 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save momotaro98/81fe10273ec42d106a36b22c79f68f6e to your computer and use it in GitHub Desktop.
Save momotaro98/81fe10273ec42d106a36b22c79f68f6e to your computer and use it in GitHub Desktop.
シェル芸人

全検索

find . -type f | xargs grep 'keyword' -n

一斉置換

$ find . -type f -name "*.yaml" -print0 | xargs -0 sed -i -e "s/HOGE/MOGA/"

ログ(CloudWatch Logsなど) 抽出

aws logs --profile prd filter-log-events --log-group-name /var/log/account/access.log --start-time $(date -v -1w +%s) | grep message | awk -F ':' '{print $9,$10}' | sort | uniq -c | sort | tail -n 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment