OS X 10.11.5 on a Mid 2011 iMac. I'm new to development on OS X and am trying to understand enough to figure out a Ruby path issue I'm having. I ran Inspector on Terminal and was surprised by the complexity of the command.

enter image description here

Instead of something like /bin/bash it is

login -pfl mark /bin/bash -c 'exec -la bash /bin/bash'

I don't understand how all these parts work together, or how the result differs from /bin/bash.


the login command is used to login to the unix system of OSX. to learn more about it type

man login

As an example if you have a terminal window open and you are also logged into the GUI desktop you are logged in 2 times. you can see how many sessions you have open by typing uptime example:

7:52  up 23:49, 2 users, load averages: 1.43 1.53 1.50

the 2 users are your terminal window and your OS X gui.

if you open another terminal window and run uptime again you will see 3 users.

17:53  up 23:50, 3 users, load averages: 1.47 1.51 1.50

The command shown in the inspector is the command used for the terminal to login to UNIX. Not what command is running in the terminal session. You can see what programs the terminal is running in the process info section of the inspector. You are only running login and bash in the screen shot you have uploaded.

To see the command of a running process select it in the inspector click the gear and click copy command. Paste it somewhere else.

  • My question went away for two reasons. 1. I discovered the "New Command" adds login. When I type /bin/bash in the "New Command" window the executed command is login -pf mark /bin/bash. 2. In Preferences, after changing "Shells open with" from "Default login shell" to "Command (complete path)" then back to "Default login shell" again, the executed command changed. It used to be the long login -pfl mark /bin/bash -c 'exec -la bash /bin/bash' but is now just login -pf mark. That bothered me a little so I created a new user, whose first-time default was login -pf mark2. – Mark Jerde May 24 '16 at 4:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .