Skip to content

Instantly share code, notes, and snippets.

@discipolo
Created April 23, 2015 22:19
Show Gist options
  • Save discipolo/56eef33b8fccd5e4830d to your computer and use it in GitHub Desktop.
Save discipolo/56eef33b8fccd5e4830d to your computer and use it in GitHub Desktop.
remove unused modules in a Drupal site with the help of Drush
unused=$(drush pm-list --no-core --pipe --type=module --status='not installed' | awk '{print "\x27" $1 "\x27" }' | tr "\n" ",") && drush sqlq "SELECT name, filename from system WHERE name IN (${unused%?});" > unused-modules.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment