DEV Community

Discussion on: Linux's commands and tricks I'm using in my daily job as a developer

Collapse
 
greyfade profile image
Charles Banas

If you're editing config files with vim and need to use that sudo tee hack, stop.

You should be using sudoedit. It safely copies the config to /tmp and runs $EDITOR as your regular user with your user config, and only overwrites the file you're editing if you actually save. This is far more desirable than running your editor as root.

Collapse
 
mx profile image
Maxime Moreau

Very good point, I think that we should never use sudo vim.