1

enter image description here

My name is Karan and so obviously the laptop is named Karans MacBook Air but I dont think it should show up every time I press enter. Please tell me how to fix this!

  • 3
    What should it say if not Karans-MacBook-Air? – Vishal Oct 2 at 15:02
4

Right now, it is showing you the default prompt, which is your computer name, current directory and the username.

export PS1="$" or export PS1="\w $" or similar (see https://ss64.com/bash/syntax-prompt.html)

should relieve you. If you're convinced, append your custom command to ~/.bash_profile and reopen Terminal.

Other than that, pressing enter is actually running an empty command, so after completion, the prompt returns to receive further ones. That is expected behaviour.

Just in case, you want to edit computer name, Go to System Preferences -> Sharing and edit it under Computer Name.

  • Hey. Thank you for answering. I got the first part. I used export PS1="$" and every now line began with a "$". But how do I make this permanent because if I reopen the terminal it again starts with the computer name, current directory and the username. I'm an absolute beginner at coding so the lingo is a bit difficult for me to understand. Can you please provide me with the code that I can copy paste to fix it permanently? – Karan Munjal Oct 5 at 19:57
  • echo 'export PS1="\w $"' >> ~/.bash_profile OR echo export PS1="$" >> ~/.bash_profile apple.stackexchange.com/questions/371614/… these answers got you covered. – ankii Oct 5 at 20:15
  • Thank you so much! Really appreciate it – Karan Munjal Oct 6 at 11:21

You must log in to answer this question.

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