yes, Jesus knew and reiterated what was in the beginning. But, then he said, [paraphrase]"You did/all that? Good. Now, sell all your things, give to the po', and there your treasure will be in Heaven. Then, come follow me.
Jesus did not say to believe in the commandments. He said to keep the commandments. Since that is impossible, as much we try to keep the commandments, we must be in Him. Jesus was also in the beginning.