variable-get core

Get a list of some or all site variables and values.

drush variable-get

  • Aliases


    variable-get has an alias:

    drush vget
  • Arguments


    variable-get accepts an argument:

    name : A string to filter the variables by. Variables whose name contains the string will be listed.
  • Options


    variable-get accepts 18 options:

    --exact : Only get the one variable that exactly matches the specified name.
    --format : Select output format. Available: labeled-export, csv, json, list, string, table, var_export, yaml. Default is labeled-export.
    --fields : Fields to output.
    --list-separator : Specify how elements in a list should be separated. In lists of lists, this applies to the elements in the inner lists.
    --line-separator : In nested lists of lists, specify how the outer lists ("lines") should be separated.
    --field-labels : Add field labels before first line of data. Default is on; --field-labels=0 to disable.
    --format=labeled-export : A list of php exports, labeled with a name.
    --format=config : A configuration file in executable php format. The variable name is "config", and the variable keys are taken from the output data array's keys.
    --format=csv : A list of values, one per row, each of which is a comma-separated list of values.
    --format=json : Javascript Object Notation.
    --format=list : A simple list of values.
    --format=php : A serialized php string.
    --format=print-r : Output via php print_r function.
    --format=string : A simple string.
    --format=table : A formatted, word-wrapped table.
    --format=var_export : An array in executable php format.
    --format=variables : A list of php variable assignments.
    --format=yaml : Yaml output format.
  • Examples


    List all variables and values.

    drush vget


    List all variables containing the string "user".

    drush vget user


    Show the variable with the exact key "site_mail".

    drush vget site_mail --exact

comments powered by Disqus