Drush has global option -y (or --yes) which allow you not to type y on every promt during given command execution. (There is also -n or --no option to which following applies as well.)

This works perfectly when you run something like:

drush en i18n -y

The propblem arises, for example, when you trying to run rsync in that manner:

drush rsync @staging:sites/all/themes @production:sites/all/themes -y

Drush just don't get the -y option, and prompts you for a confirmation.

What is this and how to make use of -y option?

  • 1
    I would gladly hear downvoting reasoning, because I run into this [not so obvious] behaviour while scripting some automation, and it was, well, annoying enough. Nov 7, 2013 at 13:57
  • -n is not the equivalent of --no, but rather --no-interaction: -n|--no-interaction see: github.com/drush-ops/drush/issues/3082
    – Jan
    Dec 13, 2021 at 8:16

1 Answer 1


The solution is to pass all global options like -y or -n before drush command:

drush -y rsync @staging:sites/all/themes @production:sites/all/themes

This allows you to pass options to a shell command run with drush without getting in conflict with drush options:

drush [global options] command [command options]

This will pass [global options] to drush, and [command options] to a shell command.

Take a habit of passing -y and other global options right after you type drush.

Run drush topic docs-strict-options to get a help on that case.

  • This is a subtle difference, yet an important one when invoking commands. Thanks!
    – tenken
    Nov 7, 2013 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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