Magento 2 Command Line Snippets

Posted on September 14, 2017 | Magento 2

A few helpful command line snippets for general Magento 2 tasks.

Reindex

bin/magento indexer:reindex

Clean Cache

bin/magento cache:clean

Flush Cache

bin/magento cache:flush

Whats the difference between Clean Cache and Flush Cache??

http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cache.html#config-cli-subcommands-cache-clean

Empty/Delete Var contents

CD into your installation folder first e.g. public_html/

rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* var/session/* var/view_preprocessed/* pub/static/* bin/magento cache:flush

Additional Commands

Sorry for the lack of explanations here, these are for my reference at the moment. Will update soon.

php bin/magento module:enable FishPig_WordPress
php bin/magento setup:upgrade
php bin/magento setup:di:compile
composer require mailchimp/mc-magento2
composer update 
composer update --no-plugins
php bin/magento maintenance:disable
php bin/magento maintenance:enable
php bin/magento setup:static-content:deploy