Using a shell marker when quoting lines to type in a terminal

Quick question: when you write instructions that include lines that should be typed into a terminal, do you include a $ or % or some other symbol at the beginning?

I've started to leave these out as I believe they're potentially confusing.

For example, I might write:

Open up your terminal and enter:

echo "Launchpad is really cool"

Now, if I'd included a "$" before the line of shell script, I'd have been misguiding my reader as I told them to enter what came next.

Sure, many readers will be familiar with the convention but I'm not sure if the convention is worth preserving, particularly as I tend to use < code > tags (or a wiki equivalent).

Any thoughts?

maybe

Interesting question. I've always used '$' but am now having second thoughts. For the above example, I'd not add '$' as you are explicitly saying "enter this" whereas sometimes an example simply shows what a command-line might look like... so I guess it depends.

So, while it depends on the medium maybe a format could exist with a separate column that contains the '$' for each command (as to show clear separation between commands)... hmm... and/or a faq that briefly explains what shell/terminal means...

Avoid

It's no longer necessarily standard to have a $ at the command prompt, and it's going to vary enough from system to system that this is just going to confuse someone, even if there's a section that says "here's what it means." If there's a chance that it's going to confuse someone, and doesn't actually add anything to the communication, I think it's a convention that could stand to go away.

FWIW, my command prompt says % rather than $. Except when I'm root, then it says #. Or when I'm ssh'ed into one of the systems I use frequently, then it's >. Oh, look, here's a system where it's $

No, I think that it's a convention that can stand to go away.

it depends on the medium

it depends on the medium maybe a format could exist with a separate column that contains the '$' for each command (as to show clear separation between commands)... hmm... and/or a faq that briefly explains what shell/terminal means...
style guide