Thursday 4 June 2020

Magento 2 all essential command line

To enable the cache:
php bin/magento cache:enable

To disable the cache:
php bin/magento cache:disable

To flush the cache:
php bin/magento cache:flush

A short command line:
php bin/magento c:f

To clean the cache in the website:
php bin/magento cache:clean

A short command line:
php bin/magento c:c


To view a list of all indexers:
php bin/magento indexer:info

View indexer status:
php bin/magento indexer:status

Reindex Command options:
php bin/magento indexer:reindex

If you want to reindex only one indexer then write following command:
php bin/magento indexer:reindex indexer_name
ex: php bin/magento indexer:status catalog_category_product

In case you fill memory limit, try this command
php -d memory_limit=10G bin/magento indexer:reindex

If any index is looping You can reset all index by using
php bin/magento indexer:reset

Current application mode:
php bin/magento deploy:mode:show

Set to production mode:
php bin/magento deploy:mode:set production

Set to developer mode:
php bin/magento deploy:mode:set developer

Set to default mode:
php bin/magento deploy:mode:set default


To install a non-optional CRON job:
php bin/magento cron:install

To remove the Magento crontab:
php bin/magento cron:remove

Run cron from the command line:
php bin/magento cron:run

To run the indexing cron job, enter:
php bin/magento cron:run --group index

To run the default cron job, enter:
php bin/magento cron:run --group default

If you enabled one or more modules, then you will need to run magento
setup:upgrade to update the database schema:
php bin/magento module:enable Nwdthemes_Module
php bin/magento setup:upgrade

1.Reach out to Smartwave extension's support team to
get the idea if they have any fix or suggestion.

2.If you do not need Smartwave_Dailydeals extension than
disable that extension / module and compile again.
3. on Magento Stack exchange a similar bug is reported
and is fixed as well, please try if that helps to fix your issue
:-
php bin/magento setup:di:compile

Simple run the following command line to deploy static content
your store when install / update an extension:
php bin/magento setup:static-content:deploy

Magento admin user created by command line:
php bin/magento admin:user:create --admin-user='adminuser' --admin-password='admin#123' --admin-email='test@test.com' --admin-firstname='Test' --admin-lastname='Tester'

How to Unlock Admin User via Command Line:
php bin/magento admin:user:unlock username
ex php bin/magento admin:user:unlock admin


No comments:

Post a Comment