0

My mac terminal prompt is:

wbk-er-10-132-118-162:~ johnjara$

I did echo $PS1 and got \h:\W \u\$, which would be the hostname: the basename of $PWD, my username, respectively. My computer name in System Preferences > Sharing is Copper's Macbook Pro.

So what is \h here for my Mac if not computer name? How do I change it? Also, why my IP address would be there in hostname?

anki
  • 11,753
aorta
  • 1
  • What is the computer name in System Preferences > Sharing? – Steve Chambers Sep 09 '19 at 19:22
  • You could do an echo $PS1 and match the codes with meanings here: https://ss64.com/bash/syntax-prompt.html and then try to figure out yourself. Numbers are definitely IP. And Steve might be right too about Computer name. See ~/.bash_profile file too. It's hidden, (notify me by @ankiiiiiii) – anki Sep 09 '19 at 19:47
  • 1
    My cpu name is Copper's Macbook Pro. @ankiiiiiii I did echo $PS1 and got \h:\W \u$ which would be the hostname, the basename of $PWD, and my username, respectively. Do either of you know why my IP address would be showing? – aorta Sep 09 '19 at 19:58
  • Here's an even closer duplicate (where the IP address is included in the name): MacOS Strange Terminal Prompt, Tried Resetting Terminal. – Gordon Davisson Sep 10 '19 at 06:00

0 Answers0