Mac – Command to remove Users “Large” and “Old” files

This command finds all files larger than 10 MB AND which haven’t been accessed in over 4 weeks:
sudo find /Users -size +10M -atime +4w

This finds the same and removes them (there is no undo!):
sudo find /Users -size +10M -atime +4w -exec rm {} \;

There appear to be large cache files being created in the Fall of 2014 …. this command removes them:
sudo find /Users -size +100M -name lsm_map -atime +2w -exec rm {} \;

When booting to external drive, this finds files 100 MBs large and 4 weeks old and lists them with “ls -lah”:
sudo find "/Volumes/Macintosh HD/Users" -size +100M -atime +4w -exec ls -lah {} \;

Lists the total size of a directory structure:
sudo du -sh /Users/xxx

 

This entry was posted in Labs and tagged . Bookmark the permalink.

Comments are closed.