Garret Wilson Garret Wilson - 1 month ago 19
Linux Question

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!

Answer

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