Adding spacers in Dock

To add spacers in dock type this command on terminal:

defaults write com.apple.dock persistent-apps -array-add ‘{“tile-type”=”spacer-tile”;}’  
killall Dock

I typed it thrice to get three spacers as:

Its a nice way to group icons on dock