Mac OS X Cleaning temp files etc.

Fooj

macrumors member
Original poster
Oct 21, 2007
72
0
Hey

I have just ordered my first mac, after years of windows, I know that with windows it is good practice to defragment hard drives, and clean temp files to keep the computer in good shape.

I am wondering what the process of doing things like this with a mac are? I know with windows there are lots of software packages to do this for you, including built in tools to windows.

Can anyone point me in the direction of some information?

There may already be something up here, but i couldnt spot it.

Incidentlly I ordered a 15.4" Macbook Pro, 2.2ghz, 2gb Ram, Glossy screen, and 160GB Hard Drive!

Cheers
 

richard.mac

macrumors 603
Feb 2, 2007
6,299
2
51.50024, -0.12662
you dont need to do it that much on macs becuase of its solid unix core. but every month i use an app called onyx. just use the automation feature and then restart your mac. after youve booted a couple of times and re-opened all your apps the system will re-cache and it will be in tip top shape again!
 

xUKHCx

Administrator emeritus
Jan 15, 2006
12,587
6
The Kop
you dont need to do it that much on macs becuase of its solid unix core. but every month i use an app called onyx. just use the automation feature and then restart your mac. after youve booted a couple of times and re-opened all your apps the system will re-cache and it will be in tip top shape again!
I used to do this but noticed no difference. I have now left OS X to do its thing for getting on 8 months. You can really just leave it alone and all will be fine.
 

superleccy

macrumors 6502a
Oct 31, 2004
978
22
That there big London
Welcome to Mac. You'll spend less time & money nursing & repairing your computer giving you more time & money to do what you want. :)

Use Disk Utility (part of OS X) to "repair permissions" on and "verify" your drives (search forums and guides to see what these mean). Although, the backup utility I use (Super Duper!) does a repair permissions anyway as part of it schedule, so that saves me a job.

There are tools out there to defrag, clean-up temp files and do other maintainance tasks, but in 3 years of Mac ownership I've never felt the need to invest time or money in them (despite me being an obsessive defragger/cleaner-upper in my PC days).

You should only need to go hunting for temp files when your hard drive gets full, and I use OmniDisk sweeper (free, essentially a disk pie-charter without the pie charts) and Spotlight to hunt-down the occasional space-wasting redundant file. A basic knowledge of the structure of the Mac OS file system comes is handy.

I think the built-in Software Update defrags your hard drive for you when it installs an OS update. Someone correct me if I'm wrong.

Good luck
SL
 

MacGiver

macrumors 6502a
Aug 12, 2007
627
29
France
I used onyx for the first time today and ran the automation thing...after restrarting my wall paper was back to the original and the ical app in the dock became an question mark...so i had to set up the wall paper back and go to application and drag back ical in the dock and get rid of the question mark...not a big deal but still wondering why this happens and if it will happen each time i run this programm...
Any idea?
Thx
X
 

superleccy

macrumors 6502a
Oct 31, 2004
978
22
That there big London
Easy. Don't run Onyx. :cool:

Sorry... I know that's not the answer you were looking for. What were you hoping Onyx would do for your brand new MacBook anyway?

But I know how old habits die hard for new switchers. For example, I have a friend who's had a Mac for a year, but still insists on rebooting a couple of times a day for no reason other than that's what he did with his PC. He thinks it keeps his Mac "running well". But there's no need.

Likewise, there's no need to hack about with 3rd party tools to optimise and customise your Mac. If you've got an actual problem, sure, fix it. Else, it's fine as it is. Just enjoy. :)

SL
 

aznmonkeybut

macrumors newbie
Feb 29, 2008
2
0
concerning temp files

hi...ive had my mac for almost 3 months and im encountering problems....for some weird reason, my volume button keeps turning off and coming back on without me touching the laptop...is this some type of spyware? or a hack? cuz i thought mac were designed so there wont be viruses...well thats what the apple guy told me...and where are the temp files located? i want to delete it because i dont feel safe with my computer acting up on me like this....thank you!
 

iCeFuSiOn

macrumors 6502a
Jul 18, 2007
511
0
You don't really need to run any maintenance tasks on Mac OS X, because in 98% of cases it will do everything for you, the other 2% is when your computer is off every evening or it never gets the chance to run the tasks because you're doing something with the system.

If you insist on running any maintenance tasks, you could run these commands in the Terminal:

WARNING! The "sudo rm -f" command is VERY dangerous, and can cause data loss if used incorrectly. Please, PLEASE, ensure that you type the commands listed below correctly, double and even triple check, I will not be held responsible if you hose your system.

1. "User-level" tasks that do not require a restart:

Run maintenance cron tasks
Code:
sudo periodic daily weekly monthly
Flush logs under your home directory
Code:
cd ~/Library/Logs
sudo rm -rf ~/Library/Logs/*
Flush cache under your home directory
Code:
rm -rf ~/Library/Safari/Downloads.plist
cd ~/Library/Caches
sudo rm -rf ~/Library/Caches/*
Flush Directory Service resolver cache (DNS, etc)
Code:
dscacheutil -flushcache
Update application pre-binding
Code:
sudo update_prebinding -root / -force
Repair disk permissions on boot volume
Code:
sudo diskutil repairPermissions /
Log out and back in to finalize the above steps.

2. "System-level" tasks that require a restart:

Clear the global cache database
Code:
cd /Library/Caches
sudo rm -rf /Library/Caches/*
Flush system cache entries
Code:
cd /System/Library/Caches
sudo rm -rf /System/Library/Caches/*
Flush LaunchServices Database (helps with multiple "Open With" entries)
Code:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
Flush Apple Type Server (ATS) cache (resolves issues with corrupt fonts some times)
Code:
sudo rm -rf `lsof | grep com.apple.ATS/annex.aux \
| grep Finder | cut -c 66-139`
sudo rm -rf /private/var/folders/*/*/-Caches-/com.apple.ATS
Repair disk permissions on boot volume
Code:
sudo diskutil repairPermissions /
Finally, restart your Mac after completing any system-wide maintenance tasks.
 

superleccy

macrumors 6502a
Oct 31, 2004
978
22
That there big London
hi...ive had my mac for almost 3 months and im encountering problems....for some weird reason, my volume button keeps turning off and coming back on without me touching the laptop...is this some type of spyware? or a hack? cuz i thought mac were designed so there wont be viruses...well thats what the apple guy told me...and where are the temp files located? i want to delete it because i dont feel safe with my computer acting up on me like this....thank you!
When their Mac does things that are unexpected, recent switchers often leap to the conclusion that they have a virus or some other malware. Understandable, perhaps, but it's unlikely to be the case.

I've not heard of any malware for the Mac that does what you describe (or in fact, any actual malware at all bar two or three isolated observations posted on this forum). Perhaps you could give us a bit more detail. Eg, are you using any 3rd party audio devices? Which sound output are you using? What Mac have you got? When it happens, does the big volume icon appear on the screen? Are you using the Apple remote?

"Temp files" isn't your problem. You have a Mac, not a PC.

SL
 

stainlessliquid

macrumors 68000
Sep 22, 2006
1,625
0
Repairing disk permissions is a good idea to do every couple of weeks, but its not really related to your question. Windows doesnt really have an equivalent to this so I cant compare it, but its a good idea to just do it with OSX since permissions get messed up a lot as you install programs over time. Usually it doesnt actually help anything, but it can prevent major disasters and sometimes fixes weird problems with the OS or apps.

Youll want to use appzapper if you want to get rid of a big program that doesnt come with an uninstaller (like the iLife stuff). That can free up a lot of space.

You can delete your internet cache using the menu option in safari. Or just straight up "reset" safari to its factory defaults.

You dont have to defrag your drive, the HFS+ file system doesnt need it.
 

aznmonkeybut

macrumors newbie
Feb 29, 2008
2
0
When their Mac does things that are unexpected, recent switchers often leap to the conclusion that they have a virus or some other malware. Understandable, perhaps, but it's unlikely to be the case.

I've not heard of any malware for the Mac that does what you describe (or in fact, any actual malware at all bar two or three isolated observations posted on this forum). Perhaps you could give us a bit more detail. Eg, are you using any 3rd party audio devices? Which sound output are you using? What Mac have you got? When it happens, does the big volume icon appear on the screen? Are you using the Apple remote?

"Temp files" isn't your problem. You have a Mac, not a PC.

SL
hi..thanks for responding...well im just using the speakers on here....i dont use the remote for this mac...umm....the mac that i have is the mac book (black) um...its a OSX Leopard....the volume button appears to show that the volume gone down or up...or mute....i dont use headphones....just the speakers it came with....idk if that helps....thanks for replying again...
 

superleccy

macrumors 6502a
Oct 31, 2004
978
22
That there big London
hi..thanks for responding...well im just using the speakers on here....i dont use the remote for this mac...umm....the mac that i have is the mac book (black) um...its a OSX Leopard....the volume button appears to show that the volume gone down or up...or mute....i dont use headphones....just the speakers it came with....idk if that helps....thanks for replying again...
Okay, thanks for the info. Doesn't really help tho, other than to rule out some possible causes. Was wondering if you had speakers or an audio interface connected to your USB or FW port... but not the case here.

If it keeps happening, then it's not right. But I don't know what it could be. Might be a hardware issue; perhaps the volume buttons on your MacBook keyboard are dodgy. Try calling Apple, see what they say.

Good luck
SL
 

kevinrohrbach

macrumors newbie
Mar 19, 2008
2
0
Don't give third-party apps the keys to your system (admin password)

Just run the scripts that iCeFusion supplied above.

Of those only the 'periodic' ones should be considered maintenance. All others go under troubleshooting and don't really need to be done regularly - although I personally do repair permissions on a 1-2 weekly basis.

Updating prebindings is only necessary when you're experiencing documents being opened by the wrong apps.

Remember to reboot straightaway if you flush system caches - this is important.

I'll reinforce iCeFusion's statement about being REALLY careful about what you type into the terminal typos are not really a good idea - especially when using the sudo (superuser) command as you are effectively telling the system that you are god and allowed to do anything including the removal of critical system files (rm command). There is no trashcan in the Terminal. rm is final.
 

Similar threads

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.