After spending a lot of time working with Magento, I kept coming back to a few command-line tasks that were worth memorizing. Rebuilding indexes was one of them.

If you want to reindex from the terminal, go to Magento’s shell directory first:

1
cd /magento/shop/path/shell/

Then run:

1
php indexer.php reindexall

You can also do it in one command:

1
php /home/cliper/magento/shell/indexer.php reindexall

Useful related commands:

1
2
php indexer.php
php indexer.php info

The first shows help and available arguments. The second lists the available Magento indexes so you can see what can be rebuilt individually.