Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
BASH script to kill most app/process logging in macOS Sierra – replace USERNAME with your username (use whois in terminal to discover this)
#!/bin/bash
for i in {1..70000};
do
NUM=`ps -o pid -p $i | grep $i `
if [ $NUM ];
then
echo " $i $NUM "
log config --process=$i --mode 'level:off'
fi
done
rm -rf /private/var/log/*
rm -rf /Library/Logs/*
rm -rf /Users/USERNAME/Library/Logs/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment