Hello Everyone,
In this blog, we will learn about Magento 2 Useful Commands for beginners.
It is not possible to keep all commands in mind when you just start a Magento 2.
So we have created a list of useful commands for Magento 2.
Without wasting your time, let us guide you straight away.
LIST OF MAGENTO 2 USEFUL COMMANDS
1. Setup Commands:
| Command | Description |
| php bin/magento setup:upgrade | Upgrade the Magento Application, DB Schema and Data |
| php bin/magento setup:di:compile | Generate DI Configuration and Missing Classes generated Automatically |
| php bin/magento setup:static-content:deploy | Deploys the static view files |
| php bin/magento setup:db-data:upgrade | Install and Update Data in the Database |
| php bin/magento setup:db:status | Check of DB update required |
| php bin/magento setup:backup | Take Backup of Magento Application, Code Base, and Media Directory |
| php bin/magento setup:cron:run | Runs the scheduled cron job |
| php bin/magento setup:performance:generate-fixtures | Generates fixtures |
| php bin/magento setup:rollback | Rollback the Magento Application, Code Base, and Media Directory |
| php bin/magento setup:config:set | Creates or Modifies the Deployment Configuration |
| php bin/magento setup:store-config:set | Sets the Store Configuration |
| php bin/magento setup:install | Install the Magento Application |
| php bin/magento setup:uninstall | Uninstall the Magento Application |
2. Cache Commands:
| Command | Description |
| php bin/magento cache:clean | Clean the cache types |
| php bin/magento cache:enable | Enable the cache types |
| php bin/magento cache:disable | Disable the cache types |
| php bin/magento cache:flush | Flush the cache storage |
| php bin/magento cache:status | Display the cache status |
3. Deploy Commands:
| Command | Description |
| php bin/magento deploy:mode:set | Sets the Application mode |
| php bin/magento deploy:mode:show | Shows the current Application mode |
4. Indexers Commands:
| Command | Description |
| php bin/magento indexer:info | Shows the available Indexers |
| php bin/magento indexer:reindex | Reindex the Data |
| php bin/magento indexer:reset | Reset Index Status to Invalid |
| php bin/magento indexer:set-mode | Set Index Mode |
| php bin/magento indexer:show-mode | Shows the Index Mode |
| php bin/magento indexer:status | Shows the status of Indexer |
5. Module Commands:
| Command | Description |
| php bin/magento module:enable | Enable the specific Module |
| php bin/magento module:disable | Disable the specific Module |
| php bin/magento module:status | Shows the status of the Module |
| php bin/magento module:uninstall | Uninstall the module that is Installed by Composer |
6. Sample Data Commands:
| Command | Description |
| php bin/magento sampledata:deploy | Deploy sample data module |
| php bin/magento sampledata:remove | Remove sample data package from composer.json file |
| php bin/magento sampledata:reset | Reset the sample data module for re-installation |
7. i18n Commands:
| Command | Description |
| php bin/magento i18n:collect-phrases | Collects the phrases in the codebase |
| php bin/magento i18n:pack | Saves language pack |
| php bin/magento i18n:uninstall | Uninstalls the language pack |
8. Catalog Commands:
| Command | Description |
| php bin/magento catalog:images:resize | Create resized product images |
| php bin/magento catalog:product:attributes:cleanup | Clear unused product attributes |
9. Maintenance Commands:
| Command | Description |
| php bin/magento maintenance:enable | Enable the maintenance mode |
| php bin/magento maintenance:disable | Disable the maintenance mode |
| php bin/magento maintenance:status | Shows the status of maintenance mode |
| php bin/magento maintenance:allow-ips | Sets the IP address for the maintenance mode |
10. Admin Commands:
| Command | Description |
| php bin/magento admin:user:create | Create an Admin User |
| php bin/magento admin:user:unlock | Unlocks the Admin Account |
11. Cron Commands:
| Command | Description |
| php bin/magento cron:run | Runs the cron Job by Schedule |
| php bin/magento cron:install | Generate and install crontab |
| php bin/magento cron:remove | Removes tasks from crontab |
12. Theme Command:
| Command | Description |
| php bin/magento theme:uninstall | Uninstall the theme |
13. Info Commands:
| Command | Description |
| php bin/magento info:adminuri | Display Magento Admin URL |
| php bin/magento info:backups:list | Display Available Backups |
| php bin/magento info:currency:list | Display Available Currencies |
| php bin/magento info:dependencies:show-framework | Display the dependencies in the Magento |
| php bin/magento info:dependencies:show-modules | Shows Dependencies between modules |
| php bin/magento info:dependencies:show-modules-circular | Shows number of circular dependencies between modules |
| php bin/magento info:language:list | Display the list of available language locale |
| php bin/magento info:timezone:list | Display available timezone |
14. Store Commands:
| Command | Description |
| php bin/magento store:list | Shows the list of available stores |
| store:website:list | Shows the list of available websites |
15. Dev Commands:
| Command | Description |
| php bin/magento dev:source-theme:deploy | Collect and display source theme files |
| php bin/magento dev:tests:run | Runs the test |
| php bin/magento dev:urn-catalog:generate | Generate URN catalog |
| php bin/magento dev:xml:convert | Convert XML files using XSL style sheets |
16. Config Commands:
| Command | Description |
| php bin/magento config:sensitive:set | Sets the sensitive configuration value |
| php bin/magento config:set | Change System Configuration |
| php bin/magento config:show | Shows configuration value for the specified path |
Final Thoughts:
So this was the easiest way which we have told you in this blog. Hope you liked the blog.
So quickly go to the comment box and tell me how you like this blog?
Stay tuned with us on our site to get new updates of Magento.
Thanks for reading and visiting our site.
