Arabic text
عَنْ أَبِي هُرَيْرَةَ رضي الله عنه عَنْ رَسُولِ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ قَالَ: «إِذَا لَقِيَ أَحَدُكُمْ أَخَاهُ فَلْيُسَلِّمْ عَلَيْهِ، فَإِنْ حَالَتْ بَيْنَهُمَا شَجَرَةٌ أَوْ جِدَارٌ أَوْ حَجَرٌ ثُمَّ لَقِيَهُ فَلْيُسَلِّمْ عَلَيْهِ أَيْضًا».
Translation
Abu Hurayrah (may Allah be pleased with him) reported that the Messenger of Allah (may Allah's peace and blessings be upon him) said: "When any of you meets his brother, let him greet him with peace. If a tree, a wall, or a rock comes between them and then he meets him, let him greet him with peace again."
Explanation
The Prophet (may Allah's peace and blessings be upon him) urges the Muslim to greet his fellow Muslim with peace whenever he meets him; even if they are walking together and something separates between them, like a tree, a wall, or a big rock, and then he meets him, he should greet him with peace once again.
Source: HadeethEnc.com