Sudo lets me edit all kinds of nutty things!

Still learning how to do as many things as possible from the command line here, am writing this down for future reference for myself. If I try to edit a file, and I’m all like “vi filename” and I do my edits and am all like “:w”, and it’s all like “no, you need to use a !” to save! And so then I’m all like “:w!” and it’s all like “E212: Can’t open file for editing.” That’s when I need to edit that sucker as root. Which means I shoulda typed in “sudo vi filename” and then my password, and then I can edit that file like no one’s business!

Leave a Reply