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

terminal login header/message?

What determines what the login header/message for terminal is?


I had this when I opened terminal:


Last login: Sat Jun  1 07:23:54 on ttys000
:~ >


After I installed a fresh copy of Mountain Lion, I got this:


Last login: Sun Jun  2 08:14:09 on console
MacBook-Pro:~ Xiaolu$


My questions is why does it say ttys000 instead of console or vice versa? What's the difference?


And I know that most of the time the header is:


hostname: (directory you're currently in) [username]$


Which is what is shown after the clean install. What would cause it to show up as it did before the clean install? It looks like a simplified version of the full header, but I have no idea what was causing that to happen. And I would much prefer it to be the simplified version.


Any ideas?

Posted on Jun 2, 2013 8:25 AM

Reply
Question marked as Best reply

Posted on Jun 2, 2013 8:46 AM

When you log in from the login window it will say "console" as the last location that you logged in. When you use the Terminal (locally or remotely) the system uses the teletype interface, which invokes a terminal device file (similar to disk0, disk1, disk2, etc., for storage devices). This file allows you to interface with the system through the Terminal.


For most intents and purposes the console and tty provide the same functionality, just that the console is a bit lower level than tty, and is only used on local access through the login window.

5 replies
Question marked as Best reply

Jun 2, 2013 8:46 AM in response to Xiaolu

When you log in from the login window it will say "console" as the last location that you logged in. When you use the Terminal (locally or remotely) the system uses the teletype interface, which invokes a terminal device file (similar to disk0, disk1, disk2, etc., for storage devices). This file allows you to interface with the system through the Terminal.


For most intents and purposes the console and tty provide the same functionality, just that the console is a bit lower level than tty, and is only used on local access through the login window.

Jun 2, 2013 8:54 AM in response to Xiaolu

As an example, log out of your account and then log back in. Then launch the Terminal. The first Terminal window you create will have "console" as the last place you logged in. However, the second one you create will have "ttys000" as the las place you logged in.


This is because the first window you created invokes the "ttys000" device file for use, so the second one reflects this. The second Terminal session likewise has its own ttys file (ttys001), so if you open a subsequent Terminal window it will say the last login was on ttys001, etc.

Jun 4, 2013 10:42 AM in response to Topher Kessler

Thank you very much, that answered the first part of my question.


I have figured out a little bit more about the second part of my questions regarding the text displayed per command line.


The change is caused by my installation of Python. Initially, it looked like this:

MacBook-Pro:~ Xiaolu$

Then, after the installation of Python, it looked like this:

:~ [1] >


The things that I installed were Activestate Python 2.7.2 found at: http://www.activestate.com/activepython/downloads


Then, I ran this bash file: http://www.cs.cornell.edu/courses/cs1110/2012fa/materials/install/bash-install.s h


The that I followed precisely can be found here under "Installing for Macintosh": http://www.cs.cornell.edu/courses/cs1110/2012fa/materials/python.php


I still don't understand exactly why the text before the command line would change. I hope these additional details gave you a better idea of what I did, and maybe you can now understand what happened in my situation. If so, please do share 🙂

terminal login header/message?

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