17

I'm following the instructions in a tutorial and they say to do sudo -E foo. I cannot find what the -E does through a google search. What does it do and how I could have found that out without asking this question?

1

2 Answers 2

23

Check the manual: man sudo

-E - The -E (preserve environment) option indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the -E option is specified and the user does not have permission to preserve the environment.

There's also ExplainShell.com that tries to explain commands with man pages.

0
6

How I could have found that out without asking this question?

Search the Linux manual pages or type man sudo in a Linux shell.


What does it do?

The -E (preserve environment) option indicates to the security policy that the user wishes to preserve their existing environment variables. The security policy may return an error if the -E option is specified and the user does not have permission to preserve the environment.

Source Sudo Manual

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .