Skip to content

Instantly share code, notes, and snippets.

@keirthomas
Last active March 16, 2018 06:27
Show Gist options
  • Save keirthomas/d79d7282005c14e5ab3a04d6c5ca0f0a to your computer and use it in GitHub Desktop.
Save keirthomas/d79d7282005c14e5ab3a04d6c5ca0f0a to your computer and use it in GitHub Desktop.
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