Press "Enter" to skip to content

Fixing : Terminal-IP address instead of computer name in Mac

0

Hey Techy, Welcome back!

Well. Today I have came across a annoying buy in terminal that will pickup the reverse IP-lookup as a host-Name rather than actual host-Name of PC. Although, it was a small things – it took me a while before realising whats going on.

To avoid you from all the hassle, I have actually decided to write this article up:


So if you are getting something like this:

192-168-1-111:~/desktop/Project Web development/project-files

And you wanted something like this:

Rohit’s MacBook Air:intro-to-node rohitbhurtel$


You came to right place. All you have to do to fix this annoying problem is: Just copy the code below and paste it to your Terminal:

PS1=’$(networksetup
-getcomputername):\W \u\$ ‘


Ta-da it should be fixed already by now. Thank you for visiting.

Don’t forget to leave your tips and tricks below in comment.

Your Comments are highly appreciated !

%d bloggers like this: