From owner-svn-src-all@FreeBSD.ORG Sat Mar 16 22:53:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB2D6757; Sat, 16 Mar 2013 22:53:39 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DD9875D; Sat, 16 Mar 2013 22:53:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2GMrdtl039703; Sat, 16 Mar 2013 22:53:39 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2GMrdNi039700; Sat, 16 Mar 2013 22:53:39 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201303162253.r2GMrdNi039700@svn.freebsd.org> From: Joel Dahl Date: Sat, 16 Mar 2013 22:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248393 - in head/usr.bin: head tail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Mar 2013 22:53:39 -0000 Author: joel (doc committer) Date: Sat Mar 16 22:53:38 2013 New Revision: 248393 URL: http://svnweb.freebsd.org/changeset/base/248393 Log: Add a couple of examples. Obtained from: OpenBSD Modified: head/usr.bin/head/head.1 head/usr.bin/tail/tail.1 Modified: head/usr.bin/head/head.1 ============================================================================== --- head/usr.bin/head/head.1 Sat Mar 16 22:53:05 2013 (r248392) +++ head/usr.bin/head/head.1 Sat Mar 16 22:53:38 2013 (r248393) @@ -28,7 +28,7 @@ .\" @(#)head.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd March 16, 2013 .Dt HEAD 1 .Os .Sh NAME @@ -57,6 +57,19 @@ where is the name of the file. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +To display the first 500 lines of the file +.Ar foo : +.Pp +.Dl $ head -n 500 foo +.Pp +.Nm +can be used in conjunction with +.Xr tail 1 +in the following way to, for example, display only line 500 from the file +.Ar foo : +.Pp +.Dl $ head -n 500 foo | tail -n 1 .Sh SEE ALSO .Xr tail 1 .Sh HISTORY Modified: head/usr.bin/tail/tail.1 ============================================================================== --- head/usr.bin/tail/tail.1 Sat Mar 16 22:53:05 2013 (r248392) +++ head/usr.bin/tail/tail.1 Sat Mar 16 22:53:38 2013 (r248393) @@ -31,7 +31,7 @@ .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 5, 2009 +.Dd March 16, 2013 .Dt TAIL 1 .Os .Sh NAME @@ -147,6 +147,17 @@ is the name of the file unless flag is specified. .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +To display the last 500 lines of the file +.Ar foo : +.Pp +.Dl $ tail -n 500 foo +.Pp +Keep +.Pa /var/log/messages +open, displaying to the standard output anything appended to the file: +.Pp +.Dl $ tail -f /var/log/messages .Sh SEE ALSO .Xr cat 1 , .Xr head 1 ,