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?
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