וּמִי כְּתָבָן מֹשֶׁה כָּתַב סִפְרוֹ וּפָרָשַׁת בִּלְעָם וְאִיּוֹב יְהוֹשֻׁעַ כָּתַב סִפְרוֹ וּשְׁמוֹנָה פְּסוּקִים שֶׁבַּתּוֹרָה
The baraita now considers the authors of the biblical books: And who wrote the books of the Bible? Moses wrote his own book, i.e., the Torah, and the portion of Balaam in the Torah, and the book of Job. Joshua wrote his own book and eight verses in the Torah, which describe the death of Moses.
(א) ויקם משה ויהושע משרתו ... ועל דעתי היה יהושע מכלל שבעים הזקנים, כי אין בישראל שבעים זקנים ראויים לקרבה אל האלקים יותר ממנו, וכאשר פירש משה מהם היה מלוה את רבו עד הגבול. ואל תקשה עלי ממאמר רבותינו בענש הזקנים האלו בתבערה (תנחומא בהעלותך [. טז), כי יאמרו כן על כלן חוץ מיהושע, לפי שהיה ראוי למראות אלקים ולכל נבואה:
(1) AND MOSES ROSE UP, AND JOSHUA HIS MINISTER. ...
In my opinion, Joshua was one of the seventy elders [who were asked to ascend the mountain], for there was nobody more worthy amongst the seventy elders of Israel to approach G-d than he, and when Moses separated from them [to ascend higher], Joshua accompanied his master up to the border [beyond which he was not permitted to go]. Now do not object to my explanation on this point from what the Rabbis have said concerning the punishment of these elders at Taberah, for they said so concerning all of them except Joshua, for he was indeed worthy to see visions of G-d and to receive prophecy.
(א) ויקם משה כו'. למדתנו התורה כי גדולה שמושה ששמש יהושע יותר מלמודן של זקנים כי הוכן יהושע יותר מהם כי הנה ויקם משה ויהושע למה שהוא משרתו ששמשו כי על שגדולה שמושה עם היות שויעל משה ולא יהושע עם כל זה נגש יהושע עד מקום שלא זכו כל השאר כי הלא אל הזקנים אמר שבו לנו בזה. ולא אמר שבו לי בזה הנה כי ממקום שלא עצרו כח הזקנים ללכת הלכו שניהם משם והלאה ולבל יתביישו כי הם לא יכלו להתקרב עד מקום שיהושע מגיע ע"כ אמר שבו לנו בזה כו' לו' תתעכבו פה והנה אהרן וחור כלו' כי הם גדולים מכם והם עמכם ולא עמנו. כלו' ולכן לא תחושו כי אין כל זה אלא לשפוט את מי שהוא בעל דברים כלומר וע"כ צריכים אתה לשבת פה ואמר זה להסתיר גדולת כבוד יהושע עליהם:
Yet despite all this I wonder! Why [of all the times that Joshua the son of Nun is cited in the Scriptures] is the name of this righteous man not once mentioned properly [i.e., ‘ben’ Nun]? Therefore I think that they used to call him in this way as a mark of honor, since he was the greatest of the disciples of Moses our teacher, and so they called him binun, meaning “the understanding one,” since there was none so discreet and wise as he. Or it may be that the meaning of it is: “Joshua, whom understanding begot;” they thus used the term nun as in the expression, may his name ‘yinon’ (be continued) as long as the sun.
while the sun lasts, may his name endure;-b
let men invoke his blessedness upon themselves;
let all nations count him happy.
R' Avraham ben HaRambam (quoted in Otzar Meforshei HaTorah to Shemos 33:11)
Even though Moshe would return to the camp for necessary activities, Yehoshua remained behind in solitude to achieve a state of prophecy.
(א) מבחוריו - מנעוריו, כמו בחרותיך,
(1) מבחוריו, as if the Torah had written: מנעוריו, ever since his youth. We find the expression בחור for a young person also in Kohelet 11,9 בימי בחורותיך, “in the days of your youth.”
רמב"ן (כתבי רמב"ן)
Ramban (cited in Otzar Meforshei HaTorah)
At times there are unique individuals that know and understand all wisdoms and contain all knowledge. And one who has knowledge and understands secrets is comparable to a prophet. And this is what is says in reference to Yehoshua, "איש אשר רוח בו".
(ג) ... והיתה הברכה חלה עליהם בסמיכה זו כאשר כתוב ביהושע (במדבר כ״ז:כ״ג) ויסמך את ידיו עליו, כדי שיאצל רוח הקדש על הנסמך...
(3) ... We find something similar in Numbers 27,23 where Moses placed his hands on Joshua and proceeded to bless him, making him his successor. The act of placing one’s hands on the person one blesses is designed to facilitate the transfer of the holy spirit possessed by the one conferring the blessing to the recipient of said blessing...