![file(1) 5.28 바이트 매개변수 사용 시 매개변수가 잘못되었습니다.](https://linux55.com/image/96170/file(1)%205.28%20%EB%B0%94%EC%9D%B4%ED%8A%B8%20%EB%A7%A4%EA%B0%9C%EB%B3%80%EC%88%98%20%EC%82%AC%EC%9A%A9%20%EC%8B%9C%20%EB%A7%A4%EA%B0%9C%EB%B3%80%EC%88%98%EA%B0%80%20%EC%9E%98%EB%AA%BB%EB%90%98%EC%97%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
버전 5.26에는 file(1)
사용자 정의 바이트 읽기 제한에 대한 지원이 추가되었습니다.
2016-03-31 13:50 Christos Zoulas <[email protected]>
* make the number of bytes read from files configurable.
를 사용하여 -P
바이트 제한을 설정할 수 있어야 합니다 . 그러나 Invalid argument
이 매개변수를 사용할 때 오류가 발생합니다. 예를 들면 다음과 같습니다.
$ file -i --mime-encoding -P bytes=15000 myinput
file: compiled magic version [528] does
file: Can't set bytes Invalid argument
관련이 있는지 확실하지 않지만 파일을 실행할 때 버전 차이 경고도 표시됩니다.file: compiled magic version [528] does not match with shared library magic version [524]
저는 5.28 파일을 사용하고 있습니다.
$ file -v
file-5.28
magic file from /etc/magic:/usr/share/misc/magic
편집하다제가 따라한 설치 과정은 다음과 같습니다.
./configure
make
make check
- 오류 없음sudo make install
make installcheck
- 오류 없음
답변1
삭제하는 것을 기억하세요libmagic소스에서 설치하기 전에 시스템에서 file
:
$ sudo apt-get purge libmagic1 file
그런 다음 다음을 설치하십시오 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 install
이것은 나에게 효과적입니다.
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
$ file -i --mime-encoding -P bytes=15000 $(which file)
/usr/bin/file: application/x-executable; charset=binary