Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MD014 - Dollar Signs in Commands

Dollar signs used before commands without showing output.

Why This Rule Exists

Including $ prompts in shell code blocks makes it harder for users to copy and paste commands. If the code block shows command output, the prompt helps distinguish input from output. Otherwise, it's just noise.

Examples

Incorrect

```bash
$ npm install
$ npm run build

### Correct (no prompts)

```markdown
```bash
npm install
npm run build

### Correct (showing output)

```markdown
```bash
$ echo "Hello"
Hello
$ ls
file1.txt  file2.txt

## Configuration

This rule has no configuration options.

## When to Disable

- Tutorial content where prompts help indicate user input
- Documents showing interactive shell sessions
- Content distinguishing between different shell types

## Rule Details

- **Rule ID**: MD014
- **Aliases**: no-dollar-signs, commands-show-output
- **Category**: Content
- **Severity**: Warning
- **Auto-fix**: Yes (removes `$` prefix)

## Related Rules

- [MD040](./md040.md) - Fenced code blocks should have language
- [MD046](./md046.md) - Code block style