Magento 2 Commands for daily use
Remarks#
All the commands can be executed writting only part of them.
For example:
php bin/magento cache:flushcan be traslated to:php bin/magento c:fphp bin/magento ca:fphp bin/magento c:flphp bin/magento cache:fphp bin/magento c:flush- etc.
You can write any part, and if it is not ambiguos, it will automatically know which one you want.
code compilation
php bin/magento setup:di:compileYou might need to delete var/di (including the folder) in order to go through compilation.
rm -rf var/diFlush Cache
Flush all Magento Cache
php bin/magento cache:clean
php bin/magento cache:flushCheck cache status
php bin/magento cache:statusEnable Custom or 3rd Party Extensions
Enable and upgrade setup
php bin/magento module:enable YKM_Custom
php bin/magento setup:upgradeDisable the Module
php bin/magento module:disable YKM_CustomAnother One - module uninstall script is executed and whole module gets deleted afterwards. Only modules installed through Composer can be uninstalled.
php bin/magento module:uninstall YKM_CustomDisplay list of enabled and disabled modules
php bin/magento module:statusUpdate the database schema and data:
php bin/magento setup:upgradeTo see all available commands
php bin/magentoGeneral List of Commands for Magento 2
php bin/magento setup:upgrade => Setup Upgrade
php bin/magento setup:di:compile => Setup: Compile
php bin/magento indexer:reindex => Reindex
php bin/magento cache:flush => Clear Cache
php bin/magento deploy:mode:set developer => Enable Developer Mode Magento (developer/production)
php bin/magento deploy:mode:show => Show Current Mode Magento
php bin/magento module:status => Module: Status
php bin/magento module:disable MODULE_NAME => Module: Disable
php bin/magento module:enable MODULE_NAME => Module: Enable
php bin/magento module:uninstall MODULE_NAME => Module: Uninstall
php bin/magento cron:run => Cronjob: Run