binfiles – filter file list and print binary executables or libraries.

Synopsis

binfiles [-n] [-d]|[-s] [-l] filenames
binfiles --help|--version

Description

binfiles reads list of files from stdin or from command line arguments. It prints to stdout names of files, detected as ELF executables, ELF libraries or statically linked libraries.

File detection is done by magic bytes in the beginning of the file. It is much more simplistic, then generic check through file(1) utility, and around 10 times faster.

ELF file (executable or library) is detected by the hex code 7f 45 4c 46.
Static library is detected by the hex code 21 3c 61 72.

Directories are checked for all files inside by default.
Symbolic links on files are ignored by default. Symbolic links on directories are followed and filtered as well.

Options

-n
Do not check and print new files inside given directories.
-d
Do not print static libraries. Turns off the effect of -s.
-s
Do not print elf files. Turns off the effect of -d.
-l
Print symbolic links on target files as well.
--version
Print version and exit with 0 code.
--help
Print short help description and exit with 0 code.

See also

readelf(1), file(1)