하루 셸 명령 Liux 텍스트 시리즈-file 명령 용법
이 명령 은 파일 형식 을 식별 하 는 데 도 사용 되 며,일부 파일 의 인 코딩 형식 을 판별 하 는 데 도 사용 된다.이것 은 윈도 우즈 가 확장자 로 파일 형식 을 확인 하 는 것 이 아니 라 파일 의 머리 정 보 를 보 는 것 을 통 해 파일 형식 을 가 져 옵 니 다.
더 많은 소 개 는 이 글 을 볼 수 있다.
file 공식 설명:Determine type of FILEs.파일 의 종 류 를 판정 합 니 다.
작은 지식:UNIX/Linux 시스템 에서 파일 형식 은 확장자 에 의 해 결정 되 는 것 이 아 닙 니 다(Windows 예).
시작 예:
1. $file file.txt
출력:file.txt:ASCII 영어 텍스트
주:file.txt 는 제 가 file Chelp< 를 사용 합 니 다.file.txt 생 성 도움말 문서
도움말
Usage: file [OPTION...] [FILE...]
Determine type of FILEs.
--help display this help and exit
-v, --version output version information and exit
-m, --magic-file LIST use LIST as a colon-separated list of magic
number files
-z, --uncompress try to look inside compressed files
-b, --brief do not prepend filenames to output lines
-c, --checking-printout print the parsed form of the magic file, use in
conjunction with -m to debug a new magic file before installing it
-e, --exclude TEST exclude TEST from the list of test to be performed for file. Valid tests are: ascii, apptype, compress, elf, soft, tar, tokens, troff
-f, --files-from FILE read the filenames to be examined from FILE
-F, --separator STRING use string as separator instead of `:'
-i, --mime output MIME type strings (--mime-type and
--mime-encoding)
--apple output the Apple CREATOR/TYPE
--mime-type output the MIME type
--mime-encoding output the MIME encoding
-k, --keep-going don't stop at the first match
-l, --list list magic strength
-L, --dereference follow symlinks (default)
-h, --no-dereference don't follow symlinks
-n, --no-buffer do not buffer output
-N, --no-pad do not pad output
-0, --print0 terminate filenames with ASCII NUL
-p, --preserve-date preserve access times on files
-r, --raw don't translate unprintable chars to \ooo
-s, --special-files treat special (block/char devices) files as ordinary ones
-C, --compile compile file specified by -m
-d, --debug print debugging messages
판독:1. -z
압축 파일 내 정보 보기
2. -b, -e, -i, Cr
-b 출력 줄 의 접두사 이름 제거
-e 테스트 목록 에서 실 행 된 파일 제거 테스트 까지.효과 적 인 테스트 는 ascii,apptype,copress,elf,soft,tar,
-i 인쇄 MIME
-R 번역 하지 않 고 인쇄 할 수 없 는 문 자 는\ooo 입 니 다.
3. magic file
mgc 를 확장자 로 하 는 파일,Microsoft office 미디어 디 렉 터 리 파일
실전 실례:
1. $file -z file.zip
file.zip 패키지 의 파일 정보 보기
2. $file Ci file.txt
out:file.txt: text/plain; charset=us-ascii
MIME 형식 인쇄
$file file.txt
out:file.txt: ASCII English text
3. magic file
나 는 번역 하기 가 정말 서투르다.$which file 만 볼 수 있 을 뿐 수확 이 없습니다.결국$file 을 통 해 얻 을 수 있 습 니 다.
Usage: file [-bchikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
[-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...
file -C [-m magicfiles]
file [--help]
그리고 file CC 에서 magic.mgc 파일 을 가 져 오 려 고 시도 합 니 다...무슨 소 용이 있 는 지 모르겠다
Usage: file [OPTION...] [FILE...]
Determine type of FILEs.
--help display this help and exit
-v, --version output version information and exit
-m, --magic-file LIST 콜론 으로 분 단 된 마법 숫자 목록 을 목록 으로 합 니 다.
-z, --uncompress 압축 파일 내용 보기
-b, --brief 출력 줄 에 접두사 파일 이름 을 붙 이지 않 음
-c, --checking-printout 마법 파일 의 해석 형식 을 인쇄 하고 설치 하기 전에-m debug 로 새로운 마법 파일 을 인쇄 합 니 다.
-e, --exclude TEST 테스트 목록 에서 실행 파일 까지 제외 합 니 다.유효한 테스트:ascii,apptype,copress,elf,soft,tar,tokens,troff
-f, --files-from FILE 검색 한 문서 에서 파일 이름 읽 기
-F, --separator STRING ":"대신 String 을 구분자 로 사용 합 니 다.
-i, --mime MIME 형식의 문자열 출력(--mime-type and
--mime-encoding)
--apple 애플 타 입 CREATOR/TYPE 출력
--mime-type MIME 형식 인쇄
--mime-encoding MIME 인 코딩 인쇄
-k, --keep-going 첫 번 째 일치 에 머 물 지 않 음
-l, --list 매 직 깊이 목록
-L, --dereference 심 볼 릭 링크 따라 가기(결 성)
-h, --no-dereference 심 볼 릭 링크 를 따 르 지 않 음
-n, --no-buffer 버퍼 없 는 출력
-N, --no-pad 출력 안 함
-0, --print0 NUL 종료 파일
-p, --preserve-date 파일 의 원래 접근 시간 유지
-r, --raw 인쇄 할 수 없 는 문 자 를\ooo 로 옮 기지 않 습 니 다.
-s, --special-files 특수(블록/문자 장치)파일 을 일반 파일 로 취급 합 니 다.
-C, --compile 컴 파일 용-m 지정 한 파일
-d, --debug 디버그 정보 인쇄
Report bugs to http://bugs.gw.com/
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
용감한 바로 가기 및 우분투 응용 프로그램안녕하세요 여러분, 이 기사에서는 모든 사이트에서 pwa를 생성하고 실행기 응용 프로그램으로 추가하는 방법을 설명하고 싶습니다. 일부 웹사이트는 PWA로 설치를 허용하지 않지만 유사한 애플리케이션을 원합니다. 1. ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.