Garret Wilson
Garret Wilson

Reputation: 21326

Does Bash ignore # after command?

I know that Bash ignores the # character at the beginning of shell script lines. But in documentation I'd like to add them at the end of lines for documentation:

ls -l #long directory listing

Just in case somebody copies and pastes the literal information I've written, will Bash ignore everything after the # character? For every command? (It seems to work in informal testing, but a reference to some definitive answer would be nice.) Thanks!

Upvotes: 2

Views: 1607

Answers (1)

Alex Kozlowski
Alex Kozlowski

Reputation: 226

Yes you can add a comment using the "#" at the end of a command: Please refer to the following link http://tldp.org/LDP/abs/html/special-chars.html

Upvotes: 4

Related Questions