script to erase all imessages in one shot

 #!/bin/bash


echo "Quitting Messages..."

killall Messages 2>/dev/null


echo "Backing up old Messages folder..."

cd ~/Library || exit 1

timestamp=$(date +%Y%m%d-%H%M%S)

cp -r Messages Messages_backup_$timestamp


echo "Deleting all Messages data..."

rm -rf ~/Library/Messages


echo "Optional cleanup of iChat cache..."

sudo rm -rf /private/var/folders/*/*/*/com.apple.iChat/* 2>/dev/null


echo "All done. Messages will start fresh next time you open it."


Popular posts from this blog

The most useful defaults-write options

Chunk validation failed

Erasing firmware password