---

How to Edit a System File with sudoedit Preserving the Invoking User Environment

On Linux and other Unix-based operating systems, sudo is used to run a program with the privileges of another user, often root. When we need to modify a file that requires administrative privileges to be edited, if we launch our favorite text editor directly with sudo, it will run without the customization and settings we use when we invoke it normally, since the environment of the invoking user is not preserved.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis