וְי֙וֹם֙ הַשְּׁבִיעִ֜֔י שַׁבָּ֖֣ת ׀ לַיהוָ֖֣ה אֱלֹהֶ֑֗יךָ לֹ֣א תַעֲשֶׂ֣ה כָל־מְלָאכָ֡ה אַתָּ֣ה וּבִנְךָֽ־וּבִתֶּ֣ךָ וְעַבְדְּךָֽ־וַ֠אֲמָתֶךָ וְשׁוֹרְךָ֨ וַחֲמֹֽרְךָ֜ וְכָל־בְּהֶמְתֶּ֗ךָ וְגֵֽרְךָ֙ אֲשֶׁ֣ר בִּשְׁעָרֶ֔יךָ לְמַ֗עַן יָנ֛וּחַ עַבְדְּךָ֥ וַאֲמָתְךָ֖ כָּמֽ֑וֹךָ׃
但第七日是向永恆者你的上帝守的安息日。這一日你不可做任何工作——你和你的兒女、僕婢、牛、驢和你一切的牲畜,以及住在你城中的寄居者,都不可做,好讓你的僕婢和你一樣得享安息。
Ibn Ezra
nor your ox, nor your donkey, nor any of your livestock a specification followed by a generalization. In the original [Exodus 20: 10] only the generalization appears; but both passages mean the same thing.
Ramban
He added here [in the commandment on the Sabbath] stating nor thine ox, nor thine ass153Verse 14. to explain that He prohibits working the earth [on the Sabbath] even though it involves the livelihood of man, similar to what He said, in plowing time and in harvest shalt thou rest.154Exodus 34:21. He stated here that thy manservant and thy maidservant may rest as well as thou; and thou shalt remember that thou wast a servant in the land of Egypt etc.,155Verses 14-15. in order to explain that He commanded concerning the resting of the servant as well as yourself, because, since you were a servant and G-d gave you rest, so you too are to give rest to your servant.156The primary concern of this law is thus not that the servant should have rest, but that we are to remember that we were servants and G-d made it possible for us to rest, and therefore we should give rest to our servants (Bachya). Thus we are prevented from becoming self-righteous as a result of “magnanimously” granting a day of rest to our servants. On the contrary, kindness to servants should be utilized as a reminder to us of our former humble position and of G-d’s kindness to us which we are to emulate to others. Thus the sense of the verses is as follows: “When your manservant and your maidservant will rest as well as you then you will remember that you were a servant etc.”
Sforno
למעו ינוח עבדך ואמתך כמוך, from the positioning of the commandment that your beasts of burden have to refrain from performing work for you on the Sabbath, before mentioning your children and servants observing such Sabbath rest, it is clear that the reasons animals owned by you must rest o the Sabbath is for the sake of the men working them, not because animals per se are subject to the spiritual concepts governing the Sabbath and its laws. The need for one’s slaves to observe the Sabbath rest is, of course, part of the reminder that when you were slaves you did not enjoy such a day of rest. Hence, do not treat your slave in the hateful you were treated when you were in his shoes.