Below are the list of most useful command list for magento 2. These commands you will need to run on command line interface or ssh.
Create admin user command:
php bin/magento admin:user:create –admin-user=abhijeet –admin-password=admin@123 –admin-email=admin@bluethink.com –admin-firstname=Abhijeet –admin-lastname=Sinha
Unlock admin user account
php bin/magento admin:user:unlock username
Setup Upgrade Using Command Line
1 2 3 4 5 |
php bin/magento setup:upgrade OR php bin/magento s:up OR php bin/magento setup:upgrade –keep-generated (If you don’t want to remove pub/static files ) |
Compile Using Command Line
1 2 3 |
php bin/magento setup:di:compile OR php bin/magento s:d:c |
Static Content Deploy Using Command Line
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
php bin/magento setup:static-content:deploy OR php bin/magento setup:static-content:deploy -f (forcely) OR php bin/magento setup:static-content:deploy en_US (for perticular language) OR php bin/magento setup:static-content:deploy –theme=Magento/backend (for magento backed theme) OR php bin/magento setup:static-content:deploy --theme Magento/luma --theme Magento/second_theme (for specific theme) OR php bin/magento setup:static-content:deploy en_US --exclude-theme Magento/luma –no-html-minify (doesn’t minify HTML files) |
Cache Clean Using Command Line
php bin/magento cache:clean
Cache Flush Using Command Line
php bin/magento cache:flush
View cache status Using Command Line
php bin/magento cache:status
Enable Cache Using Command Line
php bin/magento cache:enable [cache_type]
eg. php bin/magento cache:enable config
Disable Cache Using Command Line
php bin/magento cache:disable [cache_type]
eg. php bin/magento cache:disable config
Create Resized Product Images Using Command Line
php bin/magento catalog:images:resize
Reindexing Using Command Line
php bin/magento indexer:reindex
View Indexer Status Using Command Line
php bin/magento indexer:status
Show List Of Indexer Using Command Line
php bin/magento indexer:info
Show Mode Of Indexer Using Command Line
php bin/magento indexer:show-mode
Reset Indexer Status Using Command Line
php bin/magento indexer:reset
Remove Unused Product Attributes Using Command Line
php bin/magento catalog:product:attributes:cleanup
Check Current Mode Using Command Line
php bin/magento deploy:mode:show
Set Developer Mode Using Command Line
php bin/magento deploy:mode:set developer
Set Production Mode Using Command Line
php bin/magento deploy:mode:set production
Show All Module Status Using Command Line
php bin/magento module:status
Show Module Status Using Command Line
php bin/magento module:status Magento_TwoFactorAuth
Enable Module Using Command Line
php bin/magento module:enable Magento_TwoFactorAuth
Disable Module Using Command Line
php bin/magento module:disable Magento_TwoFactorAuth
Uninstall Module Using Command Line
php bin/magento module:uninstall Magento_TwoFactorAuth
Check Maintenance Mode Status Using Command Line
php bin/magento maintenance:status
Enable Maintenance Mode Using Command Line
php bin/magento maintenance:enable
Disable Maintenance Mode Using Command Line
php bin/magento maintenance:disable
To Enable Maintenance Mode For All Clients Except 192.0.0.1 And 192.0.0.2
php bin/magento maintenance:enable –ip=192.0.0.1 –ip=192.0.0.2
To Clear The List Of Ips From Maintenance Mode
php bin/magento maintenance:enable –ip=none
Show List Of Available Backup Files Using Command Line
php bin/magento info:backups:list
Backup Of Magento Code,Media and DB Using Command Line
1 2 3 |
php bin/magento setup:backup –code php bin/magento setup:backup –media php bin/magento setup:backup –db |
Show List Of Stores Using Command Line
php bin/magento store:list
Show List Of Websites Using Command Line
php bin/magento store:website:list
Show List Of Availble Timezones Using Command Line
php bin/magento info:timezone:list
Show List Of Availble Language Command Line
php bin/magento info:language:list
Show List Of Availble Currencies Command Line
php bin/magento info:currency:list
Show List Of Availble Language Command Line
php bin/magento info:language:list
bluethinkinc_blog
2022-10-19