I'm working on a server and need a complete list of plugins that are installed for all wp installations. I only need to know whether a plugin exists or not, it doesn't matter where it exists.
For example, given:
/siteA/wp-content/plugins/someplugin
/siteA/wp-content/plugins/anotherplugin
/siteB/wp-content/plugins/someplugin
I need the following result:
someplugin
anotherplugin
Here is the working command:
for i in $(find . -type d -name 'plugins' | grep 'wp-content/plugins$'); do find ${i} -maxdepth 1 -type d -exec sh -c 'for f do basename -- "$f"; done' sh {} + ; done | sort -u
Can this command be shortened?
for i in $(find . -type d -name 'plugins' | grep 'wp-content/plugins$'); do find ${i} -maxdepth 1 -type d -exec sh -c 'for f do basename -- "$f"; done' sh {} + ; done | sort -u
is anotherplugin plugins someplugin. Plugins isn't requisite, right? \$\endgroup\$