What does the final phrase in this Pasuk mean?
Rashi, Targum Onkelos and Targum Yonasan: It means that everything that took place in the prison was done with Yosef's authorization.
Malbim: It means that he took the place of the chief warden, and distributed the tasks among the prisoners - so that whatever was accomplished in the prison, was attributed to him.
Ha'amek Davar: He used to sell the things that the prisoners made [from which they were fed].
QUESTIONS ON RASHI
Rashi writes: "'... He would do' - As Targum translates, 'It was done by his command.'" What is added by the Targum?
Gur Aryeh: Do not interpret the verse to mean, 'Whatever needed to be done, Yosef would have to do" - that would mean he was their slave! But the verses imply that Yosef found favor in the jailer's eyes, and he was promoted. The phrase must mean that Yosef was in charge of everything that was to be done.
Rashi writes that everything done there was according to Yosef's word. Why didn't the verse simply say so?
Ohr ha'Chayim: Even though everything was done according to Yosef's word, he did not act with authority and refrain from doing things that the inmates did. Rather, he was like everyone.