Install convmv if you don't have it
sudo apt-get install convmv
Convert all files in a directory from NFD to NFC:
convmv -r -f utf8 -t utf8 --nfc --notest .
Convert all files in a directory from NFC to NFD:
convmv -r -f utf8 -t utf8 --nfd --notest .
I've created a repository with a pair of bijective scripts that do the conversion to and from NFD and does not rely on iconv:
https://github.com/hwdbk/synology-scripts/tree/master/mac-nfd-conversion
The scripts run on Mac OS X and other unixes (it uses bash and sed only). I use them on a Synology NAS, hence the names syn2mac and mac2syn, but what's in a name?
Also contains the script generating these scripts, if you want to play with it.