While working on Magento 2.x, you often need to run several console commands which are actually very handy in terms of managing the things such as cache, upgrades, deploy modes, indexers etc. You can check the entire list of commands by running this command:
php bin/magento list
Well, typing the full long commands are not very pleasant if it has to be done multiple times. So, we can use shortcuts instead full commands. This feature comes due to the Symphony framework which is used by each console class that implement command line functionality. The use Symfony\Component\Console\Command component to implement command line features. You can learn more in the documentation of Symphony framework. You can use shortest unambiguous name intead of full name, e.g. s
instead of setup
.
Now, let’s see shortcuts for some of the commonly used Magento 2 console commands:
1. Cache Commands
Where cache_type
is the parameter in which you can pass one or more cache types separated by whitespaces, e.g.
php bin/magento c:c config layout
2. Indexer Commands
You may pass parameters for particular indexer type as well.
3. Compile Command
4. Setup Upgrade Command
5. Static Content Deploy Command
6. Module Management Commands