Skip to content
  • LinkedIn
  • Twitter
  • Facebook

Desssigner.in

Aryan Srivastava | Adobe Commerce Certified Developer | Magento Tutor

  • Home
  • About Me
  • Contact
  • Toggle search form

Magento2 Useful Command List

Posted on March 25, 2022March 25, 2022 By Aryan Srivastava 1 Comment on Magento2 Useful Command List

While we are working on Magento2 store we need few of commands to be executed. But remembering all the commands is little bit tough task.
Here, I will provide you all useful command list for Magneto.

Admin

1. Create an admin user:

php bin/magento admin:user:create

Example:

php bin/magento admin:user:create --admin-user='admin' --admin-password='admin123' --admin-email='admin@xyz.com' --admin-firstname='Aryan' --admin-lastname='Srivastava'

2. Unlock admin user account

php bin/magento admin:user:unlock username

Example:

php bin/magento admin:user:unlock admin

Cache

1. Cleans cache

php bin/magento cache:clean

Short code:

php bin/magento c:c

2. Flushes cache storage

php bin/magento cache:flush

Short code:

php bin/magento c:f

3. Disables cache

php bin/magento cache:disable

Short code:

php bin/magento c:d

4. Enable cache

php bin/magento cache:enable

Short code:

php bin/magento c:e

5. Check cache status

php bin/magento cache:status

Setup

1. Setup upgrades

Upgrades the Magento application, DB data, and schema

php bin/magento setup:upgrade

Short code:

php bin/magento s:up

2. Setup compile

Generates DI configuration and all missing classes that can be auto-generated.

php bin/magento setup:di:compile

Short code:

php bin/magento s:d:c

3. Setup deploy

Deploys static view files.

php bin/magento setup:static-content:deploy

Short code:

php bin/magento s:s:d

Note: In developer/default mode we need to force deploy flag (-f) to deploy static view files.

Example:

php bin/magento setup:static-content:deploy -f

Or

php bin/magento s:s:d -f

4. Uninstall magento application

php bin/magento setup:uninstall

5. Takes backup of Magento Application code base, media and database

php bin/magento setup:backup --code --db --media

Deploy

1. Set deploy mode

Set application mode.

php bin/magento deploy:mode:set <value>

Note: Value can be:

a. developer

b. production

c. default

Example:

php bin/magento deploy:mode:set production

2. Show deploy mode

Displays current application mode.

php bin/magento deploy:mode:show

Dev

1. Enable profiler

php bin/magento dev:profiler:enable

2. Disable profiler

php bin/magento dev:profiler:disable

Maintenance

1. Show status of maintenance mode

php bin/magento maintenance:status

2. Enable maintenance mode

php bin/magento maintenance:enable

Enable maintenance mode except specific IP(s):

php bin/magento maintenance:enable --ip=127.0.0.1 --ip=127.0.0.2

3. Allow specific IP(s)

Sets maintenance mode exempt IPs.

php bin/magento maintenance:allow-ips --ip=127.0.0.1 --ip=127.0.0.2

4. Disable maintenance mode

php bin/magento maintenance:disable

Catalog

1. Create resized product image

php bin/magento catalog:images:resize

2. Removes unused product attributes in magento application using cli

php bin/magento catalog:product:attributes:cleanup

Indexer

1. Show indexer info

php bin/magento indexer:info

Short code:

php bin/magento i:info

2. Show indexer status

php bin/magento indexer:status

Short code:

php bin/magento i:status

3. Reset indexer

php bin/magento indexer:reset

Short code:

php bin/magento i:reset

4. Reindexes data

php bin/magento indexer:reindex

Short code:

php bin/magento i:rei

Module

1. Displays status of modules

php bin/magento module:status

2. Enable modules

php bin/magento module:enable <vendorname_modulename>

Example:

php bin/magento module:enable Magento_TwoFactorAuth Magento_CmsPageBuilderAnalytics

3. Disable modules

php bin/magento module:disable <vendorname_modulename>

Example:

php bin/magento module:disable Magento_TwoFactorAuth Magento_CmsPageBuilderAnalytics

Store

1. Displays the list of stores

php bin/magento store:list

2. Displays the list of websites

php bin/magento store:website:list

Cron

1. Install crontab in magento

php bin/magento cron:install

2. Run cron in magento

php bin/magento cron:run

3. Remove crontab in magento

php bin/magento cron:remove

Info

1. Displays the Magento Admin URI

php bin/magento info:adminuri

2. Prints list of available backup files

php bin/magento info:backups:list

3. Displays the list of available currencies

php bin/magento info:currency:list

4. Displays the list of available language locales

php bin/magento info:language:list

5. Displays the list of available timezones

php bin/magento info:timezone:list
Post Views: 431
Commands, Magento, Magento2 Tags:Command list, Magento2, Tutorial

Post navigation

Previous Post: How to Add Logout Tab to Customer Account in Magento 2?
Next Post: Magento2 Cheat Sheet – Frontend

Comment (1) on “Magento2 Useful Command List”

  1. Pingback: Magento2 Cheat Sheet – Frontend › Desssigner.in › Aryan Srivastava

Leave a Reply Cancel reply

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

Command list Customer Dashboard Custom Module File override Frontend How to Layout Logout link Magento Magento2 Magento2 Cheat Sheet Magento Tutorial Product Page Theme Tutorial View.xml

CERTIFICATION DIRECTORY

Adobe Commerce Front-End Developer

Adobe Certified Professional - Adobe Commerce Front-End Developer

Adobe Certified Expert-Adobe Commerce Front-End Developer

Copyright © 2023 Desssigner.in.

Powered by PressBook WordPress theme

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT