You think he knew all along?
Yes, Satan actually did know that Jesus is The Christ, God The Son. It wasn't only at the time of Lord Jesus' first coming that Satan tried to prevent the crucifixion. Satan's servants tried to prevent Christ's birth by many earlier attempts to destroy the 'Seed' of the Woman that Christ would be born through, beginning with Abel in Genesis.
Per Bible history, Satan:
1. was behind the first murder (revealed by Lord Jesus at the end of John 8); this was a direct attack on the Seed which Christ would be born through.
2. tried to split up Abraham and Sarah, since God had promised them His covenant would be with his seed after him.
3. tried to kill Jacob (by his brother Esau), because Esau claimed Jacob stole his birthright.
4. tried to have receiver of God's Birthright, Joseph, killed by his eleven brethren who smeared lamb's blood on Joseph's coat, and told his father that Joseph was dead. They then put Joseph in a pit while conspiring to actually murder him.
5. tried to kill baby Jesus through king Herod's command to execute all firstborn, in hopes of including baby Jesus. Herod was a descendant of Esau appointed king by the Romans.
6. ... tried to convert Jesus to bow to him, and he would then give all the kingdoms of this world to Jesus (Luke 4). That definitely would have prevented Christ's death on the cross, and thus prevented The Father's Salvation Plan through His Son's Blood shed upon the cross.