Of course he does—that’s why he tried to tempt him. If Jesus had succumbed, the devil would have known that Jesus wasn’t the real Messiah.
Remember, the devil isn’t God—he isn’t omniscient or infallible and so doesn’t know everything. He can make mistakes. As Thomas Aquinas put it,
The minds of demons are utterly perverted from the divine wisdom; they at times form their opinion of things simply according to the natural conditions of the same. Nor are they ever deceived as to the natural properties of anything, but they can be misled with regard to supernatural matters. For example, on seeing a dead man they may suppose that he will not rise again, or, on beholding Christ, they may judge him not to be God. (ST 1:58:5)