Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to Ubuntu and learning how to use shell. Would someone please tell me what this command does:

sudo sh -e ~/Downloads

I know sudo sh will execute all commands in the shell as sudo. What is -e ?

share|improve this question
up vote 4 down vote accepted

This is a page describing the sh command.

The sh command runs or processes jobs through the Bourne shell.

The -e flag: If not interactive, exit immediately if any untested command fails. The exit status of a command is considered to be explicitly tested if the command is used to control an if, elif, while, or until; or if the command is the left hand operand of an "&&" or "||" operator.

Also see man sh.

share|improve this answer
Thank you! That page is extremely useful. – Quaxton Hale Jun 27 '13 at 16:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.