Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

open command in Terminal

When I try to open a folder from Terminal using the open command, instead of a Finder window opening for the folder, another Terminal window opens up with contents like the following:

*Last login: Sat Nov 14 16:14:45 on ttys001*
*jt-imac:~ terrator$ /Users/terrator/Music ; exit;*
*-bash: /Users/terrator/Music: is a directory*
logout

*\[Process completed\]*



In addition, I get the same symptom when I try to open folders from the Dock and Spotlight so I think the problems are related.

I have done the following in trying to resolve this problem:

1. Repair permissions and repair disk with Disk Utility using the Installation DVD after booting from it.

2. Repair LaunchServices using Onyx

3. Created a test user to see if this user has the same problem. No, the problem doesn't happen in this user.

4. Deleted the com.appl.terminal.plist and some other plist files.

5. Reinstalled Snow Leopard on top of my existing installation.

None of those attempts have resolved the problem.

Anyone has any ideas on how to resolve this problem?

iMac Intel 24, Mac OS X (10.6.2)

Posted on Nov 14, 2009 1:22 PM

Reply
9 replies

Nov 14, 2009 1:41 PM in response to Juan Terrazas

what you've given here doesn't use the open command. that would look like this: open /Users/terrator/Music. does that work? and what do you mean by 'the same symptoms' - are you saying that trying to open a folder from the dock opens a terminal window and tells you that a path is a directory?

do folder windows open normally in the Finder (by double-clicking)?

Nov 14, 2009 2:46 PM in response to twtwtw

Issuing *open /Users/terrator/Music* from home directory doesn't work either. I get the same Terminal window with the warnings as in my original post.

By same symptoms I mean, if I try to open a folder from the Dock with the context menu then I get a Terminal window with the warnings. And I get the same when I search a folder and try to open it in Spotlight.

And yes double clicking the folder on a Finder window opens the folder.

Nov 14, 2009 6:00 PM in response to etresoft

The only lines that I see in the Console when I issue the "open Music" command is the following:

*09-11-14 8:53:39 PM login[619] USER_PROCESS: 619 ttys001*
*09-11-14 8:53:39 PM login[619] DEAD_PROCESS: 619 ttys001*

I have Microsoft Office installed but I don't seem to have the Microsoft XML converter. I looked in the Office directories and I didn't find any files with that name.

Nov 14, 2009 9:21 PM in response to Juan Terrazas

Does the following work?
*open -a Finder Music*
If this works, then maybe LaunchServives database is broken?

You can use lsregister command to view/modify the database. The lsregister command is in
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fram ework/Support

cd to this directory, and run
*./lsregister -h*
to see some help info. To view the whole contents of the database
*./lsregister -dump | less*
Search for a string "Finder.app" and "Terminal.app", and see what types are registered for each app. In my case Folder is registered under Finder.app as follows (id number may differ):

claim id: 5964
name: Folder
rank: Default
roles: Editor
flags: apple-default apple-internal
icon:
bindings: public.folder, 'fold'

Nov 15, 2009 10:51 AM in response to Jun T.

Jun T,

Thank for your input.

Issuing "open -a Finder Music" works 🙂.

I did the dump with the lsregister command and for Finder.app I see the following:

claim id: 59248
name: Folder
rank: Default
roles: Editor
flags: apple-default apple-internal
icon:
bindings: public.folder, 'fold'

For Terminal.app I don't see anything with name "Folder" but I see one with roles "Editor":

claim id: 54320
name: Terminal settings
rank: Default
roles: Editor
flags: apple-internal relative-icon-path
icon: Contents/Resources/terminal_icon.icns
bindings: com.apple.terminal.settings

And I also see one with name being blank:

claim id: 54376
name:
rank: Default
roles: Shell
flags: apple-internal
icon:
bindings: public.unix-executable

In any case, the problem doesn't happen in another user on the computer. And I wonder if this database is broken then how do I rebuild it.

Thanks,

J.

Nov 15, 2009 3:26 PM in response to Juan Terrazas

For Terminal.app I don't see anything with name "Folder" but I see one with roles "Editor":

The Terminal does not execute anything. It is a character terminal emulator that is connected to pseudo (fake) serial terminal device (/dev/pty**)

The other side of that pty device is attached to an independent process that happens to be running a shell of some kind (default being the bash shell).

The shell will create child processes on demand and run commands requested by the user. Any text send to standard out or standard error by the shell or any of the children processes started by the shell, will be sent to the pty and the Terminal will read the other side of the pty and display the text in the Terminal window.

The Terminal will also listen to the keyboard, and send any text you type to the pty where the shell or a child process created by the shell will read the other side of the pty and do what you tell it via the keyboard.

That is the Terminal's job. communicate through this fake serial device. It does not execute commands. I knows nothing about Folders, nor files, nor TYPE/CREATOR fields, nor file type suffixes. Just reads text you type, and displays text sent back from the shell or its child processes.

open command in Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.