7.16.2008

Unresponsive Dock and Finder

I can't access Dock just now. No respond. And I'm unable to go through Finder too, so I can't get a touch on Terminal. I forced quit some applications, but there's only TextEdit which I left because there's work which wasn't saved yet. Then how do I rescue this without force quitting the TextEdit which I'm not even sure if it is the cause of all this? But I'm pretty sure that it was about the hung Dock. I really wanted to avoid logging out or reboot.

But user fast switch is enabled. I logged in as administrator and used terminal to kill other's Dock process.

PS=`ps aux | awk '{if($1="amanyus") print}' | grep -i dock`; kill $PS

PS is temporary shell variable to hold a value. This value is coming from a ps command after few filtering with awk and grep. Awk only print lines that match the first column with user amanyus, which result in all amanyus' processes. Next with grep, only match insensitive case dock rather that all processes under user amanyus because we only want to find Dock process and put in the PS variable. Up to this point, PS variable will hold the process number of amanyus' Dock. After the semicolon, the process will be killed.

Silly is you just can simply use ps aux | grep amanyus | grep Dock and kill the Dock's process without bothering with awk command =p

p/s: Hey, I forgot about spotlight at the first time to search Terminal, but not sure if it would work.