Hi and welcome to LinuxQuestions!
You can edit files from the command line using sed. For example, suppose you want to delete a line containing a certain pattern (string), you can try something like:
sed -i.bck '/pattern/d' file
where 'd' is the delete command in sed. The -i option means that the file is actually changed, otherwise the result would be sent to the standard output and the original file left untouched. The -i.bck specification forces sed to do a backup copy of the original file (safe for testing purposes). The copy will have the name of the file with the specified suffix (.bck) appended.
To learn about sed secrets, a good tutorial is http://www.grymoire.com/Unix/Sed.html
. Hope this helps.