Here is how you can get things done using Magento 2 CLI indexing commands
Get into your Magento CLI command file available in Magento/bin directory
cd magento_folder/bin and run your command directly using Magento in terminal or putty.
Here is how it will work for indexing in Magento 2
##Get the list of available indexers in Magento 2##
php bin/magento indexer:info
##How to check the status of indexer##
The following command will get you the status of all the indexers whether indexing is required or ready.
php bin/magento indexer:status
You can also check the status of individual indexer: let's say I want to check the status of catalog_category_product
php bin/magento indexer:status catalog_category_product
##How to reindex all available indexing in Magento 2##
php bin/magento indexer:reindex
In case you fill memory limit, try this command
php bin/magento -dmemory_limit=2G magento indexer:reindex