MacMost Q&A Forum • View All Forum QuestionsAsk a Question

Is There a Difference Between $ and % In Terminal?

I watched a few Terminal videos tonight (I know it’s Friday night I am really cool). All the videos show a “command line(?)” that ends with a “$”. Mine has a “%” sign.

Is there any difference?
—–
Greg

Comments: 3 Responses to “Is There a Difference Between $ and % In Terminal?”

    3 years ago

    That's known as a the "prompt." It can be customized so it doesn't really matter what it is. Just a character at the beginning of a line to tell you that the Terminal is ready for the next command.

    But the bash shell usually uses $ and zsh uses % as the default. I'm guessing that while I'm using zsh in my tutorials since it is the default in macOS Terminal, you are using bash.

    "Shells" are like operating systems. In the Terminal you can use a variety of shells and switch between them. bash was the default shell in Terminal for a long time. But zsh is now the default. You weren't automatically switched to zsh if you had used bash before. But it is a setting in Terminal, Preferences, General.

    For many (most?) things, you can use either bash or zsh and they will work the same way. But sometimes you come across something you need a specific shell for, or a piece of code that would require different syntax in a different shell.

    Note though, about prompts, that there are ways to customize them to whatever you want. So I'm just making an educated guess that you are using bash and that is why you are seeing $.

    Greg
    3 years ago

    Great, thanks. I actually have the %, not the $. All the videos I watched have the $, so I was wondering. Thanks for the explanation.

    3 years ago

    Greg: They are probably videos from before Apple switched to zsh a few years back.

Comments Closed.