eject will work, but will not really "finish the job" regarding USB rotating drives.
The best way to unplug a USB external hard-drive, after proper unmounting, is:
udisks --detach /dev/sdb
EDIT: Also, as g.rocket points out, this command may be equivalent:
udisksctl power-off -b /dev/sdb