{"id":8892,"date":"2023-08-29T17:08:37","date_gmt":"2023-08-29T17:08:37","guid":{"rendered":"https:\/\/www.linuxandotherstuff.com\/?p=8892"},"modified":"2023-08-29T17:55:03","modified_gmt":"2023-08-29T17:55:03","slug":"magento-2-command-list-for-beginners","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2023\/08\/29\/magento-2-command-list-for-beginners\/","title":{"rendered":"Magento 2: Command List for Beginners"},"content":{"rendered":"\n<p>Create an admin user using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento admin:user:create --admin-user=&#039;admin&#039; --admin-password=&#039;admin123&#039; --admin-email=&#039;admin@yourwebsite.com&#039; --admin-firstname=&#039;Johy&#039; --admin-lastname=&#039;Roy\n<\/pre><\/div>\n\n\n<p><br>Unlock admin user account using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento admin:user:unlock username\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p>Setup upgrades using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:upgrade\n<\/pre><\/div>\n\n\n<p><br>Setup upgrades without removing pub\/static files using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:upgrade --keep-generated\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p>Uninstalling the Magento application using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:uninstall\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p>Cache cleaning using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:clean\n\n<\/pre><\/div>\n\n\n<p>Cache cleaning with specific type using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:clean cache_type\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Disable cache using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:disable\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Disable cache with specific type using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:disable cache_type\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Enable cache using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:enable\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Enable cache with specific type using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:enable cache_type\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Flush cache using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:flush\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Flush cache with specific type using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:flush cache_type\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Check cache status using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cache:status\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Static content deploy using the CLI: (Use -f for force deploy on 2.2.x or later)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:static-content:deploy or php bin\/magento -f setup:static-content:deploy\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Deploy for specific language using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:static-content:deploy en_US\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Deploy for Magento backend theme using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:static-content:deploy --theme=&quot;Magento\/backend&quot;\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Static content deploy for specific themes using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:static-content:deploy --theme Magento\/luma --theme Magento\/theme_number_two\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Exclude themes on static content deploy and does not minify HTML files using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:static-content:deploy en_US --exclude-theme Magento\/luma --no-html-minify\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Creates resized product images using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento catalog:images:resize\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Removes unused product attributes using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento catalog:product:attributes:cleanup\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Set Magento crontab using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cron:install --force\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Run jobs by schedule using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cron:run\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Remove Magento crontab using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento cron:remove\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Reindexing using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento indexer:reindex\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>List of indexers using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento indexer:info\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>View indexer status using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento indexer:status\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Show the mode of all indexers using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento indexer:show-mode\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Reset indexer status to invalid using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento indexer:reset\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Set index mode type using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nrealtime: Equivalent of M1 update on save\nschedule: Sets the specified indexers to save according to the cron schedule.\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento indexer:set-mode {schedule|realtime} &#x5B;indexer]\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\n<\/pre><\/div>\n\n\n<p>Example:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento indexer:set-mode schedule catalog_category_product catalog_product_category\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Collect all phrases in the Magento with 4 columns using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\\magento i18n:collect-phrases -o &quot;\\var\\www\\html\\magento\\app\\design\\i18n\\xx_YY.csv&quot; -m\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Collect all phrases in the Magento with 2 columns using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\\magento i18n:collect-phrases -o &quot;\\var\\www\\html\\magento\\app\\design\\i18n\\xx_YY.csv&quot; \\var\\www\\html\\magento\\app\\design\\frontend\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Uninstall language packages using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\\magento i18n:uninstall &#x5B;-b|--backup-code] {language package name}\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Set developer mode using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento deploy:mode:set developer\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Set production mode using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp bin\/magento deploy:mode:set production\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Check current mode using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento deploy:mode:show\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>DI compilation using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:di:compile\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>See all modules status using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento module:status\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Enable module using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp bin\/magento module:enable VendorName_ModuleName\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Disable module using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento module:disable VendorName_ModuleName\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Uninstall module using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento module:uninstall VendorName_ModuleName\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Print list of available backup files using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento info:backups:list\n<\/pre><\/div>\n\n\n<p><br>List of available currencies using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento info:currency:list\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>List of available language locales using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento info:language:list\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Display the list of available timezones using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento info:timezone:list\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Enable maintenance mode using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento maintenance:status\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Enable maintenance mode for all clients except specific IPs:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento maintenance:enable --ip=127.0.0.1 --ip=127.0.0.2\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Allow IP on maintenance mode using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento maintenance:allow-ips --ip=127.0.0.1 --ip=127.0.0.2\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Clear the list of IPs using the CLI:<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento maintenance:enable --ip=none\n\n<\/pre><\/div>\n\n\n<p><br><\/p>\n\n\n\n<p>Disable maintenance mode using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento maintenance:disable\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Check maintenance mode status using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento maintenance:status\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Display the list of stores using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento store:list\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Display the list of websites using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento store:website:list\n<\/pre><\/div>\n\n\n<p><br><br><\/p>\n\n\n\n<p>Take a backup of Magento Application code base, media, and database using the CLI:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nphp bin\/magento setup:backup\n<\/pre><\/div>\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create an admin user using the CLI: Unlock admin user account using the CLI: Setup upgrades using the CLI: Setup upgrades without removing pub\/static files using the CLI: Uninstalling the Magento application using the CLI: Cache cleaning using the CLI: Cache cleaning with specific type using the CLI: Disable cache using the CLI: Disable cache &#8230; <a title=\"Magento 2: Command List for Beginners\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2023\/08\/29\/magento-2-command-list-for-beginners\/\" aria-label=\"Read more about Magento 2: Command List for Beginners\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-8892","post","type-post","status-publish","format-standard","hentry","category-magento"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/8892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=8892"}],"version-history":[{"count":9,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/8892\/revisions"}],"predecessor-version":[{"id":8905,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/8892\/revisions\/8905"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=8892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=8892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=8892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}