I use hostname for checking:

aircrafts-MacBook-Pro:~ ldl$ hostname

there shows aircrafts-MacBook-Pro.local.

I want to know the difference between aircrafts-MacBook-Pro:~ ldl$'s aircrafts-MacBook-Pro and aircrafts-MacBook-Pro.local.


The hostname given by the "hostname" command is the fully qualified hostname (i.e. the full hostname including domains, etc.).

The one displayed in the prompt is shown because your /etc/bashrc file contains the following prompt definition for bash (your shell):

PS1='\h:\W \u\$ '

The first part of the prompt specification "\h" means that the hostname should be displayed in the prompt - but only the hostname up to the first . (dot).

That's why you see two different things.

You must log in to answer this question.

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