Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    Instead of a command I just use a #, which works as long as you have not told your shell to ignore comment lines. Commented Mar 20, 2013 at 15:18
  • @jw013 That's a good approach too to reduce typing, but I was shooting for an option that was shell-agnostic. Commented Mar 20, 2013 at 15:26
  • 1
    I think # is a comment character in every shell that I have seen, even weird ones like csh. It's even in the POSIX spec (see item 10.). I'd love to know if you've seen shells where # is not a comment. Commented Mar 20, 2013 at 15:38
  • 1
    It's not in zsh in interactive mode (by default): ➜ #ls zsh: command not found: #ls Commented Mar 20, 2013 at 15:46
  • I have always used echo as the command for this. This can cause issues if your weird characters interpreted by the shell, like * or !, so I often times go with the single quotes around it all as well. Commented Mar 20, 2013 at 17:51