Linux 헤드/테일 명령의 매뉴얼 페이지에 '-LINES' 인수가 표시되지 않습니다.

Linux 헤드/테일 명령의 매뉴얼 페이지에 '-LINES' 인수가 표시되지 않습니다.

방금 책에서 이 명령이 head -LINES파일의 첫 번째 LINES 줄을 표시한다는 내용을 읽었습니다. 그러나 head의 매뉴얼 페이지에서는 이것이 정당한 주장임을 밝히지 않는 것 같습니다. 내가 무엇을 놓치고 있는지 알고 싶습니다.

tail참고: 의 매뉴얼 페이지 에서도 마찬가지인 것 같습니다 .

답변1

이는 표준적인 주장이 아닙니다. 아주 초기 유닉스 시스템의 잔재일 뿐이다. GNU 헤드/테일에 대한 자세한 내용은 다음에서 확인할 수 있습니다 info head.

   For compatibility ‘head’ also supports an obsolete option syntax
‘-[NUM][bkm][cqv]’, which is recognized only if it is specified first.
NUM is a decimal number optionally followed by a size letter (‘b’, ‘k’,
‘m’) as in ‘-c’, or ‘l’ to mean count by lines, or other option letters
(‘cqv’).  Scripts intended for standard hosts should use ‘-c NUM’ or ‘-n
NUM’ instead.  If your script must also run on hosts that support only
the obsolete syntax, it is usually simpler to avoid ‘head’, e.g., by
using ‘sed 5q’ instead of ‘head -5’.

OpenBSD에는 man head더 짧은 메모가 있습니다.

The historic syntax -count is supported by this implementation.

관련 정보