Archive for the ‘finder’ Category

Killing Finder or Dock (or any other mac OS X application)

Wednesday, March 11th, 2009

When an application in OS X is stalling on you and you have given up on regaining control of it, the best thing to do is kill it before it takes down your whole machine. Usually you would right click on the application icon in the Dock and choose the menu item “Quit” or “Force Quit” if available and that should do the trick.

Dock Menu When Right Clicking Application

Dock Menu When Right Clicking Application

Or you could click on the top left corner “apple” icon which will bring up a menu where you will see something called “Force Quit”. Choosing that option will open a small window with a list of the running applications which you can forcibly kill.

Force Quit Applications

Force Quit Applications

Sometimes though a key component of OS X fails on you which you don’t have an option to force quit like the above mentioned methods. I came to such a situation when the Dock froze on me the other day. It just would not come up at all. Today I had a similar situation when I had cover flow switched on in the finder while I was browsing an external hard drive that has 20 gigs of hundreds of subfolders inside hundreds of subfolders that contain thousands of photos. Cover flow could not handle this and it wouldn’t allow me to do antyhing else either. I had an application crunching data for the past 5 hours so restarting the machine was definitely not an option. I needed a way to cleanly kill Finder without destroying any other work going on. In situations like this you need to go beyond the GUI and directly to the terminal. Yes, I know, now that I am writing this article, I noticed that the “Force Quit” application actually has Finder as an option but being someone from a linux background I immediately go to Terminal for anything I need rather than look for GUI solutions.

What you need to do is find the PID (Process ID) of the application you need to kill. To do this, type the following in Terminal:

ps aux | grep Finder

The result of that command will be something like:

sergemadenian   131 97.1 25.9  1213744 542124   ??  R    Fri12PM  54:49.70 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -psn_0_40970
sergemadenian  3932   0.1  0.0   590472    192 s000  R+   10:07PM   0:00.00 grep Finder

“ps aux” is the command that prints out all the currently running processes from all users. ” | grep Finder” will restrict the results of the “ps” command to show only the lines that contain the word “Finder”.

From the above result you can tell that the Finder application is question is the first line and I have set the PID in Bold and red “131″. You can also tell that this process is struggling because immediately after the pid we see the CPU and memory usage which in this case is “97.1 25.9″ (those are percentages).

Now that we know the PID (131) all you need to do is run the command:

kill -9 131

“-9″ tells the OS to kill immediately. That took care of the offending Finder window and I noticed that a new Finder process had been kicked off by the OS. If a new process had not automatically been kicked off, I would have had to start it manually by running the command that was running before which I’ve marked in blue and bold ”

Same process applies to any application including the Dock. All you need to do is find the specific PID by changing what you filter with grep. For the Dock as an example, you will need to run:

ps aux | grep Dock

Remember that the PID is not a universal number (that is your Finder application will not have 131, even my computer will have a different PID for Finder when I restart it) so you need to always find the unique PID running at the time.

Renaming files and folders in Finder (OS X)

Sunday, June 3rd, 2007

Another commonly used function that took me a while to understand how to accomplish in OS X is to rename files. It took me quite some time to figure this one out and eventually I found the shortcut by accident.

First off I was trying to right click (or on the macbook using the trackpad to click on the file with two fingers which acts like a right click) and the following menu comes up:

File actions menu (right click)

As you can see in the above screen capture, there’s no option to rename the file. If you’d like to know how to capture the screen on OS X, look at our previous post: Mac OS X Screen Capture
Next, I thought maybe it would be in the finder edit menu at the top of the screen and maybe I could also find the shortcut key for renaming.

Finder Edit menu

Again the edit menu doesn’t show anything related to renaming a file.

After trying many different things, I went into the “Get Info” dialog box when I right clicked on the file. The following dialog box comes up:

File info dialog box

In this dialog box under the “Name and extension” section, you can see there is a text edit box with the name of the file. Modifying that text box and closing the dialog box will rename the file.

That is an extremely difficult to find method of renaming a file. You have to remember that I’m very new to macs and OS X and so it was not immediately obvious to me. I also couldn’t find a shortcut in renaming until I accidentally tried to use the keyboard to navigate through folders.

Navigating through folders on linux or windows involves arrow keys to pick a file or folder and the enter key to open or go into that folder. I was doing the same when I noticed that pressing the “enter” key on OS X is the actual keyboard shortcut to rename the file or folder.

So there you have it, the fastest way to rename a file in finder is to click on the file and press the “enter” key on the keyboard.