eda871d2ba881d0133c17a6071f38e711a5c037e
[yaffs-website] / vendor / drush / drush / docs / usage.md
1 Usage
2 -----------
3
4 Drush can be run in your shell by typing "drush" from within any Drupal root directory.
5
6     $ drush [options] <command> [argument1] [argument2]
7
8 Use the 'help' command to get a list of available options and commands:
9
10     $ drush help
11
12 For even more documentation, use the 'topic' command:
13
14     $ drush topic
15
16 Options
17 -----------
18
19 For multisite installations, use the --uri option to target a particular site.  If
20 you are outside the Drupal web root, you might need to use the --root, --uri or other
21 command line options just for Drush to work.
22
23     $ drush --uri=http://example.com pm-updatecode
24
25 If you wish to be able to select your Drupal site implicitly from the
26 current working directory without using the --uri option, but you need your
27 base_url to be set correctly, you may force it by setting the uri in
28 a drushrc.php file located in the same directory as your settings.php file.
29
30 ```
31 $options['uri'] = "http://example.com";
32 ```
33
34 Site Aliases
35 ------------
36
37 Drush lets you run commands on a remote server, or even on a set of remote
38 servers.  Once defined, aliases can be referenced with the @ nomenclature, i.e.
39
40 ```bash
41 # Run pending updates on staging site.
42 $ drush @staging updatedb
43 # Synchronize staging files to production
44 $ drush rsync @staging:%files/ @live:%files
45 # Synchronize database from production to dev, excluding the cache table
46 $ drush sql-sync --structure-tables-key=custom @live @dev
47 ```
48
49 See [example.aliases.drushrc.php](https://raw.githubusercontent.com/drush-ops/drush/master/examples/example.aliases.drushrc.php) for more information.
50