2

I want to do a raw dump of a single node's data with Drush, for testing purposes and just to inspect a node fast. Similar to getting a variable with "drush vget". Here is a PHP equivalient:

drush php-eval "print print_r(node_load(243271), 1)";

Only, I'd like it to be simplified to be like:

drush nget 243271;

Is there a command like that already?

4

Install this set of Drush tools to either your $HOME/.drush directory or within your project.

Drush Entity

Brief examples from the project page are:

drush entity-read node 3  |  less


#read in json format
drush entity-read node 3 --format=json


drush entity-type-read user


drush entity-type-read node --fields=label


drush entity-type-read user node --fields=label,bundles/*/label,drush/count

EDIT

For legacy Drupal6 support of viewing what a Node contains consider using Node Export via the command line and drush, possibly using the --pipe command to Linux Less command.

  • I'm embarrassed to ask... but do you know of something that works in D6? – Gavin Jan 22 '15 at 23:30
  • The Node Export [drupal.org/project/node_export] module works with D6 and can use Drush as well (drush supports D6). It has various output formats like JSON and CSV for example. I recommend tagging posts here with the version number of drupal your inquiry is about. I just assume questions are about the most current stable/supported version of drupal if it is unspecified. – tenken Jan 22 '15 at 23:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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