Skip to main content
Post Closed as "Duplicate" by Seth
added 27 characters in body; edited title
Source Link
Zanna Mod
  • 71.6k
  • 3
  • 67
  • 161

What is a betterbest practice for writing commands? With $ or without $?

I want to know what is the best way to write and highlight a command? is.

manyMany people (with a lot moreof reputation) write itcommands like this:

$ sudo apt-get update

ifIf someone copies this command as it is, it wontwon't work (mostand I think many people do that, causebecause I remember I did at one point)


someSome people write it like this sudo apt-get update I think this is used when there is just a single command and it's written within a statement, like I just did.


I choose to write it like most people

sudo apt-get update

I consider this is the most logical way to go about it


my question isMy questions are

  • shouldShould I edit out $ signs?
  • Does $ sign meansmean something more than what my ground assumptions are?
  • Or simply, what is the correct way to do it?

this question was inspired by thought of editing this answer

What is a better practice for writing commands?

I want to know what is the best way to write and highlight a command?

many people (with a lot more reputation) write it like this

$ sudo apt-get update

if someone copies this command as it is, it wont work (most people do, cause I remember I did at one point)


some people write it like this sudo apt-get update I think this is used when there is just a single command and it's written within a statement, like I just did.


I choose to write it like most people

sudo apt-get update

I consider this is the most logical way to go about it


my question is

  • should I edit out $ signs?
  • Does $ sign means something more than what my ground assumptions are?
  • Or simply what is the correct way to do it?

this question was inspired by thought of editing this answer

What is best practice for writing commands? With $ or without $?

I want to know what the best way to write and highlight a command is.

Many people (with a lot of reputation) write commands like this:

$ sudo apt-get update

If someone copies this command as it is, it won't work (and I think many people do that, because I remember I did at one point)


Some people write it like this sudo apt-get update I think this is used when there is just a single command and it's written within a statement, like I just did.


I choose to write it like most people

sudo apt-get update

I consider this is the most logical way to go about it


My questions are

  • Should I edit out $ signs?
  • Does $ sign mean something more than what my ground assumptions are?
  • Or simply, what is the correct way to do it?

this question was inspired by thought of editing this answer

Source Link

What is a better practice for writing commands?

I want to know what is the best way to write and highlight a command?

many people (with a lot more reputation) write it like this

$ sudo apt-get update

if someone copies this command as it is, it wont work (most people do, cause I remember I did at one point)


some people write it like this sudo apt-get update I think this is used when there is just a single command and it's written within a statement, like I just did.


I choose to write it like most people

sudo apt-get update

I consider this is the most logical way to go about it


my question is

  • should I edit out $ signs?
  • Does $ sign means something more than what my ground assumptions are?
  • Or simply what is the correct way to do it?

this question was inspired by thought of editing this answer