sed – stream editor

You want to use sed to prefix a line with a #, given by the linenumber 18?

sed -i '{18s/^/#/}' theFile.txt