Skip to content

Instantly share code, notes, and snippets.

@eukras
Last active September 18, 2015 00:03
Show Gist options
  • Save eukras/0cf8b89da19d375792df to your computer and use it in GitHub Desktop.
Save eukras/0cf8b89da19d375792df to your computer and use it in GitHub Desktop.
Some Diagnostic Shortcuts
# Proper tree view of directories (Bash)
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
# Database table sizes (MySQL, MB)
SELECT SUM(data_length / (1024 * 1024)), table_schema, table_name Data_MB FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','performance_schema','mysql') GROUP BY table_schema, table_name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment