Here is a quick tip on how to use sed to replace a line in a text file from the command line, without opening it.
Replace a Line in a File
First, replace the text you want with sed and output it into a temporary file to ensure that it is correct:
# sed -e 's/original-text/new-text/' textFile > newFile
newFile and make sure that the line is correctly replaced:
# more newFile
textFile with the
# mv newFile textFile