Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Question:

Question: Use Terminal to empty cache

My Safari cache won't empty. What is the Terminal command to do so?

MacBook, OS X Mavericks (10.9.1)

Posted on

Reply

Page content loaded

Jul 22, 2014 11:37 AM in response to Terry Brown In response to Terry Brown

I don't know the terminal command for emptying the Safari caches.


But you can try this.


Quit Safari if open.

Option click the "Go" menu in the Finder menu bar.

Select "Library" and then "Caches".

Look for the folder 'com.apple.Safari"

Right click "com.apple.Safari" and select "Move to Trash"

Relaunch Safari.

Jul 22, 2014 11:37 AM

Reply Helpful

Jul 23, 2014 1:37 AM in response to Terry Brown In response to Terry Brown

You can delete Safari's cache file. First, check its size using the disk usage (du) command:

du -h /Users/$HOME/Library/Caches/com.apple.Safari/Cache.db


Note: Replace "$HOME" with the name of your home folder. You can use the user identity (id) command to find it:


id -un

Next, delete Safari's cache file:

rm /Users/$HOME/Library/Caches/com.apple.Safari/Cache.db

Safari will create a new Cache.db file automatically when you open a new webpage. Open a new webpage or restart Safari and recheck disk usage:

du -h /Users/$HOME/Library/Caches/com.apple.Safari/Cache.db



Warning: when you use the remove (rm)command files are essentially unrecoverable. A more prudent approach is to use the move (mv) command:


mv /Users/$HOME/Library/Caches/com.apple.Safari/Cache.db ~/.Trash/

This will move the file to your user's ($HOME) trash. From there it is still recoverable until you empty the trash.

Jul 23, 2014 1:37 AM

Reply Helpful
User profile for user: Terry Brown

Question: Use Terminal to empty cache