Skip to content

Instantly share code, notes, and snippets.

@Matrixbirds
Last active January 17, 2017 02:58
Show Gist options
  • Select an option

  • Save Matrixbirds/0c8e6e938df3fef04978acfcd75fd8eb to your computer and use it in GitHub Desktop.

Select an option

Save Matrixbirds/0c8e6e938df3fef04978acfcd75fd8eb to your computer and use it in GitHub Desktop.
sysadmin codebase
## query condition and display line
## select line number
cat puma.stdout.log | grep '<condition>' -n | awk '{split($0, a, ":I"); print a[1]}'
## select range
export h=head -n1
export t=tail -n1
sed -n '$(h),$(t)p' puma.stdout.log | less -N
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment