Depending on your settings the magento command will start with: php bin/magento or  bin/magento

bin/magento --help or bin/magento -h

bin/magento help

bin/magento list list all possible commands

Cron

bin/magento cron:run

Index management 
bin/magento indexer:reindex

More about index commands

Cache
bin/magento cache:status 
bin/magento cache:disable
bin/magento cache:flush
bin/magento cache:clean

bin/magento cache:clean [type] ... [type]
bin/magento cache:flush [type] ... [type]

Cleans enable caches (check cache status), it does not purge the cache storage so it does not affect other processes or applications. It is safer than flush. Flushes purge cache storages.

More about cache commands 

Modes: Production vs developer
bin/magento deploy:mode:show 
bin/magento deploy:mode:set {mode}
bin/magento deploy:mode:set developer
bin/magento deploy:mode:set production

 

Upgrade and Deploy 
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy

Admin URL

bin/magento info:adminuri
bin/magento admin:user:unlock <username>

 

Module

bin/magento module:status
bin/magento module:enable <Vendor_Module>
bin/magento module:disable <Vendor_Module>

Maintenance
bin/magento maintenance:status
bin/magento maintenance:allow-ips Sets maintenance mode exempt IPs
bin/magento maintenance:disable
bin/magento maintenance:enable

Catalog/Images

bin/magento catalog:images:resize
bin/magento catalog:product:attributes:cleanup Removes unused product attributes

Working with less in Magento 2

grunt exec:<your_theme>
grunt less:<your_theme>
grunt watch

less breakpoints

@screen__xxs: 320px;
@screen__xs: 480px;
@screen__s: 640px;
@screen__m: 768px;
@screen__l: 1024px;
@screen__xl: 1440px;

Leave a Reply

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

Post comment