Magento2 : Basic Command

Setup Upgrade Using Command Line
php bin/magento setup:upgrade
Cache Clean Using Command Line
php bin/magento cache:clean 
Cache Flush Using Command Line
php bin/magento cache:flush 
Static Content Deploy
php bin/magento setup:static-content:deploy 
Reindexing
php bin/magento indexer:reindex 
View the list of indexers
php bin/magento indexer:info
See all modules Status
php bin/magento module:status 
Enable module
php bin/magentomodule:enable Namespace_Module
Disable module
php bin/magento module:disable Namespace_Module
To run unit test case 
php bin/magento dev:tests:run unit 
To run specific unit test case 
./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml
To run specific integration test case 
../../../vendor/bin/phpunit --testsuite "test suite name"
After Install Magento2 Do some basic configration in project
Set Developer Mode
Magento comes  different modes.  (developer, production)
To enable developer module open the .htaccess file and uncomment the line “SetEnv MAGE_MODE developer”
after you uncomment magento2 will be set in developer model
Also run
php bin/magento deploy:mode:set developer
php bin/magento deploy:mode:show
Disable Cache
Login into magento admin, navigate to
System -> Cache Management
disable all caches here
you can manage cache from command line using
php bin/magento cache:disable
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento cache:status
php bin/magento cache:enable
Set Permissions
If you get permission error, cannot create directory error in any of the above command or in website
make sure to do below
sudo chmod -R 777 pub/
sudo chmod -R 777 var/



Comments