Last active
November 14, 2019 03:04
-
-
Save esimonetti/06c153808a7c829b70a8ba522be7b761 to your computer and use it in GitHub Desktop.
Useful sugar file system commands to analyse an instance
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
# Quick way to tell the difference of the modules dir of two instances | |
# 1 - from within the vanilla system module's dir | |
cd modules | |
ls -la | awk '{ print $9 }' | grep -v '\.' | grep -v '\.\.' > ~/core_modules_dir.txt | |
# 2 - from within the customer system module's dir | |
cd modules | |
ls -la | awk '{ print $9 }' | grep -v '\.' | grep -v '\.\.' > ~/customer.txt | |
# 3 - diff the twos and do some fus to get the actual differences | |
diff -auNw ~/core_modules_dir.txt ~/customer.txt | grep + | grep -v "@" | cut -c 2- | grep -v "\+\+" | grep -v "\-\-" | |
# Find custom fields per module from the file system | |
cd cache/modules | |
find . -name *vardefs.php | xargs -I {} bash -c 'echo {} && grep custom_ {} | grep source | wc -l' | sed 's/ //g' | sed 'N;s/\n/ /' > ~/custom_fields_count.txt | |
# Find if there are any modules with role based views active | |
find ./custom * | grep -P "[a-f0-9\-]{36}" | grep -v history | grep -v working | grep -v "ext.php" | grep php | |
# Files that changed in the past 5 minutes | |
find . -mmin -5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment