Muni Bus

パソコンの操作方法や設定方法を忘れないようにメモしています。ブログを一回引っ越ししているので、所々表示がかなり乱れています・・・

【Linux】ファイル形式を調べる

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