'\" te .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved Portions .\" Copyright 1989 AT&T .\" Portions Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .TH head 1 "2012 年 1 月 21 日" "SunOS 5.11" "ユーザーコマンド" .SH 名前 head \- ファイルの最初の数行の表示 .SH 形式 .LP .nf \fB/usr/bin/head\fR [\fB-number\fR | \fB-n\fR \fInumber\fR] [\fIfilename\fR]... .fi .SH 機能説明 .sp .LP \fBhead\fR ユーティリティーは、\fIfilename\fR で指定された各ファイルについて、先頭の何行か (行数は \fInumber\fR で指定) を標準出力に出力します。\fIfilename\fR が指定されない場合、\fBhead\fR は標準入力から行をコピーします。\fInumber\fR のデフォルト値は \fB10\fR 行です。 .sp .LP 複数のファイルが指定された場合、各ファイルの先頭は次のようになります。 .sp .in +2 .nf \fB==>\fR \fIfilename\fR \fB<==\fR .fi .in -2 .sp .LP したがって、複数の小さいファイルの内容を、各ファイルを識別できるように表示する際、一般的な方法として、次のようにこのコマンドを使用できます。 .sp .in +2 .nf example% \fBhead -9999 filename1 filename2 ...\fR .fi .in -2 .sp .SH オプション .sp .LP サポートしているオプションは、次のとおりです。 .sp .ne 2 .mk .na \fB\fB-n\fR \fInumber\fR\fR .ad .RS 13n .rt 各入力ファイルの先頭の何行を標準出力に書き出すか、その行数を \fInumber\fR で指定します。\fInumber\fR の値は正の整数でなければなりません。 .RE .sp .ne 2 .mk .na \fB\fB-\fR\fInumber\fR \fR .ad .RS 13n .rt \fInumber\fR は正の整数で、意味は前述の \fB-n\fR \fInumber\fR 指定と同じです。 .RE .sp .LP オプションが指定されていない場合、\fBhead\fR は \fB-n\fR \fB10\fR が指定されたものとして動作します。 .SH オペランド .sp .LP 次のオペランドを指定できます。 .sp .ne 2 .mk .na \fB\fB\fIfilename\fR\fR\fR .ad .RS 12n .rt 入力ファイルのパス名。\fIfile\fR オペランドを指定しないと、標準入力が使用されます。 .RE .SH 使用法 .sp .LP ファイルが 2G バイト (2^31 バイト) 以上ある場合の \fBhead\fR の動作については、\fBlargefile\fR(5) を参照してください。 .SH 使用例 .LP \fB例 1 \fRディレクトリ中のすべてのファイルの先頭 10 行を出力する .sp .LP 次の例は、ピリオドで始まるものを除くディレクトリ中のすべてのファイルの先頭の 10 行を出力します。 .sp .in +2 .nf example% \fBhead *\fR .fi .in -2 .sp .SH 環境 .sp .LP \fBhead\fR の実行に影響を与える次の環境変数についての詳細は、\fBenviron\fR(5) を参照してください。 \fBLANG\fR、\fBLC_ALL\fR、\fBLC_CTYPE\fR、\fBLC_MESSAGES\fR、および \fBNLSPATH\fR。 .SH 終了ステータス .sp .LP 次の終了ステータスが返されます。 .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt 正常終了。 .RE .sp .ne 2 .mk .na \fB>\fB0\fR\fR .ad .RS 6n .rt エラーが発生した。 .RE .SH 属性 .sp .LP 属性についての詳細は、マニュアルページの \fBattributes\fR(5) を参照してください。 .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性タイプ属性値 _ 使用条件system/core-os _ CSI有効 _ インタフェースの安定性確実 _ 標準T{ \fBstandards\fR(5) を参照してください。 T} .TE .SH 関連項目 .sp .LP \fBcat\fR(1), \fBmore\fR(1), \fBpg\fR(1), \fBtail\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)