Using file may not be so simple: # file /boot/zImage-3.19.3-1-default /boot/zImage-3.19.3-1-default: Linux kernel ARM boot executable zImage (little-endian) # file -v file-5.19 Perhaps that was the reason for the existence of get_kernel_version. Any reason not to use just the file name (or link name, don't de-reference), as Ludwig suggested?