There were various types of voyagers in the medieval Muslim world, including ardent pilgrims, wandering dervishes, and enterprising merchants. But, starting in the 8th century CE (2nd century Hijri), another large contingent joined the ranks of the itinerants: many Muslims began traveling extensively in pursuit of sacred knowledge, especially (but not limited to) to hear and write down ḥadīths (sayings of the Prophet Muhammad) from those who were transmitting them.
Muhammad ibn Idris al-Shafi`i (d. 204H / 897CE, poet and Muslim jurist) wrote the following lines encouraging people to travel (and he probably had the knowledge-voyager type of travel in mind):
Become estranged from home, seek loftiness! And travel, for in travel are five gains: Dispelling worries, earning livelihood., And knowledge, manners, noble company. You say: But its fatigue and loneliness, Traversing deserts, bearing great travails? I say: I'd rather die than live where I Am lowly, prey to treach'rous enviers.
تغرب عن الاوطان في طلب العلا *** وسافر ففي الاسفار خمس فوائد
تفريج هم واكتساب معيشة *** وعلم وآداب وصحــــــــبة ماجد
فإن قيل في الاسفار ذل وغربة *** وقطع فيافٍ وارتكاب الـــــشدائد
فمـــوت الفتى خير له من حياته *** بدار هوان بين واش وحاســـــد
Three centuries later, Qadi Turtushi (d. 520 H/1126 CE, a judge from from Tortosa in Catalonia – today in Spain), wrote a rejoinder poem to Shafi`is, encouraging people not to travel. Tartushi himself had traveled considerably in pursuit of knowledge, even though he was said to be more devoted to pious devotions and frugality than scholarship.
Stay home, shun travel if you seek success! For travel brings you seven handicaps: You lose your friends, you miss beloved kin, Expenses rise, and robbers target you, Much loneliness, and scarce a confidante, And worst of all, my friend, the roadside inns! You say: but traveling brings livelihood, And knowledge, manners, noble company. I say: that was an era that's long passed, The current times are full of hindrances. Mark well these words, for now I close with peace. Or try it out; you'll see reality.
تخلف عن الاسفار ان كنت طالبا *** نجاة ففي الاسفار سبع عوائق
تنكر اخوان وفقد أحبــــــــــــــــة *** وتشتيت اموال وخيفة سارق
وكثرة ايحاش ٍ وقلة مـــــــــؤنس *** وأعظمها ياصاح سكنى الفنادق
فان قيل في الاسفار كسب معيشة*** وعلم وآداب وصحبة فائــــــــق
فقل ذاك دهر تقادم عهـــــــــده *** واعقبه دهر كثير العوائـــــــق
وهذا مقالي والسلام مؤبـــــــد *** وجرب ففي التجريب علم الحقائق
– Suheil Laher
PICTURE CREDIT: Cairo (1840s), https://digitalcollections.nypl.org/items/510d47e0-0ec9-a3d9-e040-e00a18064a99