Skip to content

Instantly share code, notes, and snippets.

@ejoubaud
Last active January 1, 2016 23:19
Show Gist options
  • Save ejoubaud/8215712 to your computer and use it in GitHub Desktop.
Save ejoubaud/8215712 to your computer and use it in GitHub Desktop.
Pipable MySQL output
mysql -uroot -e 'query;' -BN
# -B stands for --bash which usese tab as a separator instead of the annoying tab-like pipes
# -N stands for --skip-column-names which removes the column names header
# Usage Example: Kills all processes created by the ejoubaud user
mysql -uroot -e 'show processlist;' -BN | grep ejoubaud | cut -f1 | xargs -n1 kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment