WP-CLI

WP-CLI is a set of command-line tools for managing WordPress websites. With just a few simple commands, you can manage WordPress from the command line without the need to login to the Admin Dashboard and navigate the pages. You can install, update and delete plugins and themes, perform backups, configure standard and multisite installs and much more — all without ever using a web browser.

How to install WP-CLI

$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Make WP-CLI Executable

$ chmod +x wp-cli.phar

Rename wp-cli.phar to wp and move to a folder where it can be executed globally.

$ sudo mv wp-cli.phar /usr/local/bin/wp

How to Install and Activate Theme from the command line

$ wp theme install twentytwelve
$ wp theme activate twentytwelve

How to Install, Activate, Deactivate a Plugin

$ wp plugin install hello-dolly
$ wp plugin activate hello-dolly
$ wp plugin deactivate hello-dolly

How to update WordPress to the latest core release

$ wp core update

How to list the last 5 posts

$ wp post list --post_type=post --posts_per_page=5 --format=json

The command above will spit out an array in JSON format.

Read the rest of WP-CLI documentation.