The terminal is a powerful tool. Getting yourself acclimatized to its inner workings is very valuable. If you mastered DOS at any point in your life, then the terminal shouldn’t be any more daunting. They’re different, but the principles remain the same.
Sometimes the fastest way to unfreeze some system crashes is to open up the terminal and type in a quick command. If you don’t believe me, check out these three quick fixes for OS X crashes.
Fix some crashy spaces
Spaces has been running pretty good for me since Snow Leopard was released, but I still manage to crash it every now and again. Usually my crash kills my dock, and the end result is spaces not switching to the proper space after I click on an icon in the finder. This is usually a dock problem, so restarting the dock is quick fix.
Fix an unresponsive menu bar
The menubar is known to crash. It’s not often, but those little application icons up there in the top right of your screen are actually small programs. If they’re poorly written, they could really bork your system. Knowing how to restart them manually is a good thing to remember. It’s saved my butt a couple of times.
The SystemUI Server that you’re “killing” is a process that not only controls the menubar and the menu extras, but it also controls handling what applications open when you insert a DVD or CD, and it also controls other devices you’ve plugged in like an iPod, etc.
If you’re prone to yanking your iPod out of the plug without ejecting, there’s a possibility that the SystemUIServer might choke a little bit, and potentially freeze. It’s rare, but it happens.
Stop Finder from freezing
Back when I was on Tiger my Finder crashed almost religiously when I was trying to browse the network, and when I was connecting to a server through the finder. I never really figured out why, but I was able to find a way to stop my finder from getting that famous beachball of death. It’s one thing to have your computer hang up for a couple of minutes, it’s another thing when it hangs up for 30mins when a deadline is approaching quickly. Being able to restart the finder at your leisure is something that you’ll need to do on occasion, unless you have ample time to wait for your system to come back to life.
Killall kills a lot of things–a little more complicated
If you have a process that’s going nuts, maybe it’s eatting up system resources, or maybe you just don’t like the look of it, you can kill it with killall. You need to figure out the process id first using the ‘ps’ command in the terminal. For example, if you type ‘ps aux’ in the terminal, you’ll get a list of all the process that are running. Usually the PID is listed in the second column, right after the user name that’s running the process.
The next step is running the following code, and inputting the proper PID into the command.
killall -9 PID
There. The process is dead.
What did you think would happen? So, here’s where we put up a disclaimer. If you have know idea what a process is you’re going to want to not do this last little killall command. You don’t want to be closing stuff that your system needs. No comments telling me I didn’t warn you, puhleeze.