Tradition; It was that way when I learnt it early 80s when we were told it was a convention & they had no special meaning other than $=work (money; where you will earn your living), #=danger (it could go bad and you'll see the "#"'s as appeared then on batman tv shows instead of hits or violence)
The problem is they can easily be changed, and are shell specific. I learnt what I said before at univeristy where we used bourne SHell; the modern BASH having replaced original bourne SHell so it follows its traditions.
If you use other shells those "$" and "#" could be replaced by other characters (eg. "%" depending on shell chosen).
Further as stated they can be replaced via $PS1 (prompt) so should not be relied on to mean anything anyway.
They are at best an indication of what shell you may be using, and what level of environment (user or root) you may be in - but it's far safer to assume nothing.
Tradition; It was that way when I learnt it early 80s when we were told it was a convention & they had no special meaning other than $=work (money; where you will earn your living), #=danger (it could go bad and you'll see the "#"'s as appeared then on batman tv shows instead of hits or violence)
The problem is they can easily be changed, and are shell specific. I learnt what I said before at univeristy where we used bourne SHell; the modern BASH having replaced original bourne SHell so it follows its traditions.
If you use other shells those "$" and "#" could be replaced by other characters (eg. "%" depending on shell chosen).
Further as stated they can be replaced via $PS1 (prompt) so should not be relied on to mean anything anyway.
They are at best an indication of what shell you may be using, and what level of environment (user or root) you may be in - but it's far safer to assume nothing.