The command-line interface in Linux/UNIX is extremely powerful due to the combinable features of a shell and a vast number of different programs. You can discover new tools all the time. For example, I recently discovered that the
sudo package has the
sudoedit command to edit files as root.
So instead of
The advantage of this is that the editor is run as your user, not as root, increasing security. Works in Linux and OS X.
There is a bit more information here: https://wiki.archlinux.org/index.php/Sudo#Editing_files.