Skip to content

Instantly share code, notes, and snippets.

@keirthomas
Last active March 16, 2018 06:27
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
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