file is a Linux utility that can be used to determine the type of a file by looking at its contents.

For example:

$ file ./executable

./executable: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52/lib/ld-linux-x86-64.so.2, BuildID[sha1]=3385e73bcf21627632679eb08bdfc1e3f0b8586b, for GNU/Linux 3.10.0, not stripped