Magento 2 Commands

  1. Command to delete generation folder from var directory :  
     rm -rf var/di var/generation 
  2. Command to delete cache:
    php bin/magento cache:flush
  3. Command to upgrade modules :
     php bin/magento setup:upgrade
  4. Command to compile modules:
     php bin/magento setup:di:compile
  5. Command to reindex data:
     php bin/magento indexer:reindex
  6. Command to deploy css and js files :
     php bin/magento setup:static-content:deploy
  7. Command to set developer mode :
     php ./bin/magento deploy:mode:set developer