Last active
January 1, 2016 23:19
-
-
Save ejoubaud/8215712 to your computer and use it in GitHub Desktop.
Pipable MySQL output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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