Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Useful sugar file system commands to analyse an instance
# 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
You can’t perform that action at this time.