How to exploit all commands in Magento 2 CLI (Part 3)

In this article we explain you how to exploit all commands in Magento 2 CLI (Part 3)

Part 3: Examine modules using CLI

Everyone knows Magento 2 has a powerful command-line interface tools (CLI). It permits you to complete task including installation, configuration, database backups, compiling LESS etc. Here I will show you how to examine modules using command in Magento 2. Before starting this guide please, refer our previous guidelines.

The following steps which shows you how to examine modules using CLI:

Step 1: install/uninstall modules

  • install
php bin/magento setup:upgrade

The above command will install and update the database of all modules in Magento 2.

Note: Then run this command, you should modify the mode of var &pub folder

chmod -R 777 var

 chmod -R  777 pub
  • uninstall module
 php bin/magento module:uninstall [--backup-code] [--backup-media] [--backup-db] [-r|--remove-data] [-c|--clear-static-content] \

{ModuleName} ... {ModuleName}
php bin/magento module:uninstall --backup-code  --backup-media --backup-db -r -c Webnexs_BannerSlider

The following command will uninstall the module Webnexs_Bannerslider

The below mentioned tabulation defines the options of uninstall module command

Option Description Directory System
-backup- code Backup Magento files (exclude the var and pub/static folder) var/backups/<timestamp>_filesystem.tgz
-backup- media Backup the pub/media folder var/backups/<timestamp>_filesystem_media.tgz
-backup-db Backup the database of  Magento site var/backups/<timestamp>_db.gz

Step 2: Enable/disable Module


  • Enable
php bin/magento module:enable [-c|–clear-static-content] [-f|–force] [–all] <module-list>
  • Disable
php bin/magento module:disable [-c|–clear-static-content] [-f|–force] [–all] <module-list>

The below tabulation explain the option of this command

Option Description
-c | –clear-static-content Clean static view files (pub/static)
-f | –force Force a module to be enabled or disabled despite dependencies
–all Enable or disable all modules at the same time
<module- A space-delimited list of modules to enable or disable, such as: Magento_Catalog Magento_CatalogSearch

The following command will disable module Webnexs_Bannerslider

php bin/magento module:disable -c -f Webnexs_BannerSlider

Step 3: Update database of modules

Upgrade database schme

php bin/magento setup:db-schema:upgrade

Upgrade data

php bin/magento setup:db-data:upgrade

The above mentioned step is the simplest process for you to exploit all commands in Magento 2 CLI. With this guideline you can manage the product image in checkout in Magento 2 is effortless. All stores has a change product image in checkout cart in Magento 2 with several elements






Leave a Reply

Your email address will not be published. Required fields are marked *