Minecraft 1.13.1 Inventory Count NBT Tag [duplicate]

NBT setting can often be done without types, namespaces or similar, but testing has to be exact:

/execute as @a[nbt={Inventory:[{id:"minecraft:command_block",Count:5b}]}]

Also, keep in mind that this will not match a player with e.g. one stack of 2 and one stack with 3 command blocks.