fileコマンドを使う。以下、とある環境下での実行例。
$ file /etc/passwd /etc/passwd: ASCII text $ file /bin/df /bin/df: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=9cf621c9e844518f837b089a1aec71fe5f72a40e, stripped $ file /etc/init.d/ssh /etc/init.d/ssh: POSIX shell script, ASCII text executable