find /directory1/directory2/ -maxdepth 1 -type f | sort | tail -n 5 | xargs md5sum
find lists the files, no recursion, no directories, with full pathsort list files alphabeticallytail keep only the last 5 filesxargs send the list as arguments to md5summd5sum calculate the md5sum for each fileProbably can't handle spaces in file or directory names.