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!
Asked
Active
Viewed 284 times
1 Answers
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.
anki
- 11,753
-
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 05 '19 at 19:57
-
echo 'export PS1="\w $"' >> ~/.bash_profileORecho export PS1="$" >> ~/.bash_profilehttps://apple.stackexchange.com/questions/371614/how-to-add-the-path-for-mysql-bin-on-mac/371665 these answers got you covered. – anki Oct 05 '19 at 20:15 -

Karans-MacBook-Air? – Vishal Oct 02 '19 at 15:02