This question already has an answer here:
So I'm making this adventure map, and kinda got tired of placing NBT command blocks one by one.
Is there a way to fill an area with command blocks that already have a command in them?
The closest i got was just filling an area with command blocks, then manually putting the command on each one of them. But honestly that was too tiresome.
/fill ~ ~-1 ~ ~15 ~-1 ~15 minecraft:command_block
Am i missing anything?