README.txt

  1. 6.x tests/README.txt
  2. 6.x lib/README.txt
  3. 3.x README.txt
  4. 4.x tests/README.txt
  5. 4.x README.txt
  6. 5.x tests/README.txt
  7. 5.x README.txt
  8. 5.x lib/README.txt
DESCRIPTION
-----------
Drush is a command line shell and Unix scripting interface for Drupal.
If you are unfamiliar with shell scripting, reviewing the documentation
for your shell (e.g. man bash) or reading an online tutorial (e.g. search
for "bash tutorial") will help you get the most out of Drush.

Drush core ships with lots of useful commands for interacting with code
like modules/themes/profiles/translations. Similarly, it runs update.php, executes sql
queries and DB migrations, and misc utilities like run cron or clear cache.

INSTALLATION
------------
For Linux/Unix/Mac:
  1. Untar the tarball into a folder outside of your web site (/path/to/drush)
     (e.g. if drush is in your home directory, ~/drush can be used for /path/to/drush)
  2. Make the 'drush' command executable:
       $ chmod u+x /path/to/drush/drush
  3. (Optional, but recommended:) To ease the use of drush,
     - create a link to drush in a directory that is in your $PATH, e.g.:
       $ ln -s /path/to/drush/drush /usr/local/bin/drush
     OR
     - create an alias to drush:
       $ alias drush='/path/to/drush/drush'
       For example, if drush is in your home directory:
       $ alias drush='~/drush/drush'
       This goes into .profile, .bash_aliases or .bashrc in your home folder.
       NOTE:  You must log out and then log back in again or re-load your bash
       configuration file to apply your changes to your current session:
       $ source .bashrc

     NOTE FOR ADVANCED USERS
     - If you want to run drush with a specific version of php, rather than the
       one found by the drush command, you can instead create an alias that
       executes the drush.php file directly:
       $ alias drush='/path/to/php/php5 /path/to/drush/drush.php'
       If you do this, to allow Drush to detect the number of available columns,
       you need to add the line 'export COLUMNS' to the .profile file in your
       home folder.

  4. Start using drush by running "drush" from your Drupal root directory.

     (or, if you did not follow step 3, by running "/path/to/drush/drush"
      or navigating to /path/to/drush and running "./drush" )

    If you have troubles, try using the -l and -r options when invoking drush. See below.

For Windows:
  - Follow step 1. Use drush by navigating to /path/to/drush
    and running 'drush.bat'.
  - You have to install gzip, libarchive, tar and wget executables. Go to
    http://gnuwin32.sourceforge.net/packages.html and install the packages.
    Add the folder %ProgramFiles%\GnuWin32\bin to your PATH.
    Documentation can be found at http://drupal.org/node/594744  
  - Whenever the documentation or the help text refers to
   'drush [option] <command>' or something similar, 'drush' has to be replaced
    by 'drush.bat'.
  - If drush.bat is not working for you, either add the directory in which your
    php.exe resides to your PATH or edit drush.bat to point to your php.exe.

USAGE
-----
Once installed and setup, you can use drush as follows while in
any Drupal directory:

  $ drush [options] <command> [argument1] [argument2]

Use the 'help' command to get a list of available options and commands:

  $ drush help

For multisite installations, you might need to use the -l or other command line
options just to get drush to work:

  $ drush -l http://example.com help

Related Options:
  -r <path>, --root=<path>      Drupal root directory to use
                                (default: current directory or anywhere in a Drupal directory tree)
  -l <uri> , --uri=<uri>        URI of the drupal site to use
                                (only needed in multisite environments)
  -v, --verbose                 Display verbose output.
  --php                         The absolute path to your php binary.

NOTE: If you do not specify a URI with -l and drush falls back to the default
site configuration, Drupal's $GLOBAL['base_url'] will be set to http://default.
This may cause some functionality to not work as expected.

The drush cli command provide a customized bash shell with support for handy new
functions like cdd which whisks you to any directory in your drupal site.

Many commands support a --pipe option which returns machine readable output. See
`drush pm-list --status=enabled --pipe` as an example

EXAMPLES
--------
Inside the "examples" folder you will find some example files to help you
get started with your drush configuration file (example.drushrc.php),
site alias definitions (example.aliases.drushrc.php) and drush commands
(example.drush.inc).

DRUSHRC.PHP
--------
If you get tired of typing options all the time, you can add them to your drush.php alias or
create a drushrc.php file. These provide additional options for your drush call. They provide
great flexibility for a multi-site installation, for example. See example.drushrc.php.

SITE ALIASES
--------
Drush lets you run commands on a remote server, or even on a set of remote servers.
See http://drupal.org/node/670460 and example.aliases.drushrc.php for more information.

COMMANDS
--------
Drush ships with a number of commands, but you can easily write
your own. In fact, writing a drush command is no harder than writing simple
Drupal modules, since drush command files closely follow the structure of
ordinary Drupal modules.

See example.drush.inc for light details on the internals of a drush command file.
Otherwise, the core commands in drush are good models for your own commands.

You can put your drush command file in a number of places:

  - In a folder specified with the --include option (see above).
  - Along with one of your existing modules. If your command is related to an
    existing module, this is the preferred approach.
  - In a .drush folder in your HOME folder. Note, that you have to create the
    .drush folder yourself.
  - In the system-wide drush commands folder, e.g. /usr/share/drush/commands

In any case, it is important that you end the filename with ".drush.inc", so
that drush can find it.

REQUIREMENTS
------------
* To use drush from the command line, you'll need a CLI-mode capable PHP
  binary. The minimum PHP version is 5.2.
* drush also runs on Windows; however, drush commands make use of
  unix command line tools, so to use it effectively, you have to install
  some of them, e.g. from GnuWin32 (http://gnuwin32.sourceforge.net/). More info
  about Drush on Windows available at http://drupal.org/node/594744.
* Drush works with Drupal 5, Drupal 6 and Drupal 7.  However, occasionally
  recent changes to the most recent version of Drupal can introduce issues
  with drush.  On Drupal 5, drush requires update_status v5.x-2.5 or later
  in order to use pm-updatecode.  If you have an earlier version of update_status,
  upgrade it via "drush dl update_status" before using pm-updatecode.

FAQ
---
  Q: What does "drush" stand for?
  A: The Drupal Shell.

  Q: How do I pronounce drush?
  A: Some people pronounce the dru with a long u like drupal. Fidelity points go to
  them, but they are in the minority. Most pronounce drush so that it rhymes with
  hush, rush, flush, etc. This is the preferred pronunciation.

CREDITS
-------
Originally developed by Arto Bendiken <http://bendiken.net/> for Drupal 4.7.
Redesigned by Franz Heinzmann (frando) <http://unbiskant.org/> in May 2007 for Drupal 5.
Maintained by Moshe Weitzman <http://drupal.org/moshe> with much help from
Owen Barton, Adrian Rossouw, greg.1.anderson.

File

README.txt
View source
  1. DESCRIPTION
  2. -----------
  3. Drush is a command line shell and Unix scripting interface for Drupal.
  4. If you are unfamiliar with shell scripting, reviewing the documentation
  5. for your shell (e.g. man bash) or reading an online tutorial (e.g. search
  6. for "bash tutorial") will help you get the most out of Drush.
  7. Drush core ships with lots of useful commands for interacting with code
  8. like modules/themes/profiles/translations. Similarly, it runs update.php, executes sql
  9. queries and DB migrations, and misc utilities like run cron or clear cache.
  10. INSTALLATION
  11. ------------
  12. For Linux/Unix/Mac:
  13. 1. Untar the tarball into a folder outside of your web site (/path/to/drush)
  14. (e.g. if drush is in your home directory, ~/drush can be used for /path/to/drush)
  15. 2. Make the 'drush' command executable:
  16. $ chmod u+x /path/to/drush/drush
  17. 3. (Optional, but recommended:) To ease the use of drush,
  18. - create a link to drush in a directory that is in your $PATH, e.g.:
  19. $ ln -s /path/to/drush/drush /usr/local/bin/drush
  20. OR
  21. - create an alias to drush:
  22. $ alias drush='/path/to/drush/drush'
  23. For example, if drush is in your home directory:
  24. $ alias drush='~/drush/drush'
  25. This goes into .profile, .bash_aliases or .bashrc in your home folder.
  26. NOTE: You must log out and then log back in again or re-load your bash
  27. configuration file to apply your changes to your current session:
  28. $ source .bashrc
  29. NOTE FOR ADVANCED USERS
  30. - If you want to run drush with a specific version of php, rather than the
  31. one found by the drush command, you can instead create an alias that
  32. executes the drush.php file directly:
  33. $ alias drush='/path/to/php/php5 /path/to/drush/drush.php'
  34. If you do this, to allow Drush to detect the number of available columns,
  35. you need to add the line 'export COLUMNS' to the .profile file in your
  36. home folder.
  37. 4. Start using drush by running "drush" from your Drupal root directory.
  38. (or, if you did not follow step 3, by running "/path/to/drush/drush"
  39. or navigating to /path/to/drush and running "./drush" )
  40. If you have troubles, try using the -l and -r options when invoking drush. See below.
  41. For Windows:
  42. - Follow step 1. Use drush by navigating to /path/to/drush
  43. and running 'drush.bat'.
  44. - You have to install gzip, libarchive, tar and wget executables. Go to
  45. http://gnuwin32.sourceforge.net/packages.html and install the packages.
  46. Add the folder %ProgramFiles%\GnuWin32\bin to your PATH.
  47. Documentation can be found at http://drupal.org/node/594744
  48. - Whenever the documentation or the help text refers to
  49. 'drush [option] <command>' or something similar, 'drush' has to be replaced
  50. by 'drush.bat'.
  51. - If drush.bat is not working for you, either add the directory in which your
  52. php.exe resides to your PATH or edit drush.bat to point to your php.exe.
  53. USAGE
  54. -----
  55. Once installed and setup, you can use drush as follows while in
  56. any Drupal directory:
  57. $ drush [options] <command> [argument1] [argument2]
  58. Use the 'help' command to get a list of available options and commands:
  59. $ drush help
  60. For multisite installations, you might need to use the -l or other command line
  61. options just to get drush to work:
  62. $ drush -l http://example.com help
  63. Related Options:
  64. -r <path>, --root=<path> Drupal root directory to use
  65. (default: current directory or anywhere in a Drupal directory tree)
  66. -l <uri> , --uri=<uri> URI of the drupal site to use
  67. (only needed in multisite environments)
  68. -v, --verbose Display verbose output.
  69. --php The absolute path to your php binary.
  70. NOTE: If you do not specify a URI with -l and drush falls back to the default
  71. site configuration, Drupal's $GLOBAL['base_url'] will be set to http://default.
  72. This may cause some functionality to not work as expected.
  73. The drush cli command provide a customized bash shell with support for handy new
  74. functions like cdd which whisks you to any directory in your drupal site.
  75. Many commands support a --pipe option which returns machine readable output. See
  76. `drush pm-list --status=enabled --pipe` as an example
  77. EXAMPLES
  78. --------
  79. Inside the "examples" folder you will find some example files to help you
  80. get started with your drush configuration file (example.drushrc.php),
  81. site alias definitions (example.aliases.drushrc.php) and drush commands
  82. (example.drush.inc).
  83. DRUSHRC.PHP
  84. --------
  85. If you get tired of typing options all the time, you can add them to your drush.php alias or
  86. create a drushrc.php file. These provide additional options for your drush call. They provide
  87. great flexibility for a multi-site installation, for example. See example.drushrc.php.
  88. SITE ALIASES
  89. --------
  90. Drush lets you run commands on a remote server, or even on a set of remote servers.
  91. See http://drupal.org/node/670460 and example.aliases.drushrc.php for more information.
  92. COMMANDS
  93. --------
  94. Drush ships with a number of commands, but you can easily write
  95. your own. In fact, writing a drush command is no harder than writing simple
  96. Drupal modules, since drush command files closely follow the structure of
  97. ordinary Drupal modules.
  98. See example.drush.inc for light details on the internals of a drush command file.
  99. Otherwise, the core commands in drush are good models for your own commands.
  100. You can put your drush command file in a number of places:
  101. - In a folder specified with the --include option (see above).
  102. - Along with one of your existing modules. If your command is related to an
  103. existing module, this is the preferred approach.
  104. - In a .drush folder in your HOME folder. Note, that you have to create the
  105. .drush folder yourself.
  106. - In the system-wide drush commands folder, e.g. /usr/share/drush/commands
  107. In any case, it is important that you end the filename with ".drush.inc", so
  108. that drush can find it.
  109. REQUIREMENTS
  110. ------------
  111. * To use drush from the command line, you'll need a CLI-mode capable PHP
  112. binary. The minimum PHP version is 5.2.
  113. * drush also runs on Windows; however, drush commands make use of
  114. unix command line tools, so to use it effectively, you have to install
  115. some of them, e.g. from GnuWin32 (http://gnuwin32.sourceforge.net/). More info
  116. about Drush on Windows available at http://drupal.org/node/594744.
  117. * Drush works with Drupal 5, Drupal 6 and Drupal 7. However, occasionally
  118. recent changes to the most recent version of Drupal can introduce issues
  119. with drush. On Drupal 5, drush requires update_status v5.x-2.5 or later
  120. in order to use pm-updatecode. If you have an earlier version of update_status,
  121. upgrade it via "drush dl update_status" before using pm-updatecode.
  122. FAQ
  123. ---
  124. Q: What does "drush" stand for?
  125. A: The Drupal Shell.
  126. Q: How do I pronounce drush?
  127. A: Some people pronounce the dru with a long u like drupal. Fidelity points go to
  128. them, but they are in the minority. Most pronounce drush so that it rhymes with
  129. hush, rush, flush, etc. This is the preferred pronunciation.
  130. CREDITS
  131. -------
  132. Originally developed by Arto Bendiken <http://bendiken.net/> for Drupal 4.7.
  133. Redesigned by Franz Heinzmann (frando) <http://unbiskant.org/> in May 2007 for Drupal 5.
  134. Maintained by Moshe Weitzman <http://drupal.org/moshe> with much help from
  135. Owen Barton, Adrian Rossouw, greg.1.anderson.