How to skip certain directories when running updatedb

How to skip certain directories when running updatedb

To skip certain directories when running updatedb edit

/etc/updatedb.conf

and add the directories you want to skip to the PRUNEFS configuration variable

PRUNEFS="/tmp /my/giant/directory"

That is it,  then run updatedb again,  it will skip the listed directory,   in my case updatedb ran much faster.