Release 5.26 of file(1) added support for user-defined byte read limit:2016-03-31  13:50  Christos Zoulas <christos@zoulas.com>    * make the number of bytes read from files configurable.By using -P one should be able to set the byte count limit. However, I get a Invalid argument error when using the parameter, e.g.:$ file -i --mime-encoding -P bytes=15000 myinputfile: compiled magic version [528] does file: Can't set bytes Invalid argumentNot sure if related, but I also get a version discrepancy warning when running file: file: compiled magic version [528] does not match with shared library magic version [524]I'm using file 5.28.$ file -vfile-5.28magic file from /etc/magic:/usr/share/misc/magicEDIT This is the installation procedure I followed:./configuremakemake check - no errorssudo make installmake installcheck - no errors
file(1) 5.28 Invalid argument when using bytes parameter
files
Remember to remove libmagic from your system before installing file from sources:$ sudo apt-get purge libmagic1 fileThen, to install file:$ wget ftp://ftp.astron.com/pub/file/file-5.28.tar.gz$ tar xvzf file-5.28.tar.gz$ cd file-5.28$ ./configure --prefix=/usr$ make$ sudo make installThat worked for me:$ lsb_release -aDistributor ID: UbuntuDescription:    Ubuntu 16.04.1 LTSRelease:        16.04Codename:       xenial$ file -i --mime-encoding -P bytes=15000 $(which file)/usr/bin/file: application/x-executable; charset=binary