From owner-freebsd-questions Sun Oct 14 19:22:29 2001 Delivered-To: freebsd-questions@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id 13A8D37B408 for ; Sun, 14 Oct 2001 19:22:23 -0700 (PDT) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 4357D6AB1A; Mon, 15 Oct 2001 11:52:21 +0930 (CST) Date: Mon, 15 Oct 2001 11:52:21 +0930 From: Greg Lehey To: scanner@jurai.net Cc: Scott Gerhardt , FreeBSD Subject: Re: "nl" command Message-ID: <20011015115221.H69347@wantadilla.lemis.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from scanner@jurai.net on Sun, Oct 14, 2001 at 10:18:19PM -0400 Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sunday, 14 October 2001 at 22:18:19 -0400, scanner@jurai.net wrote: > On Sun, 14 Oct 2001, Scott Gerhardt wrote: > >> I'm new to FreeBSD but not new to Linux/UNIX so bear with me. >> I tried using "nl" to number lines in standard out put and I got this: >> >> 102 scott@blue: /home/scott > ls -al | ln >> usage: ln [-fhinsv] file1 file2 >> ln [-fhinsv] file ... directory >> link file1 file2 > > You typed ln not nl. ln is for making symbolic links. ln is used for making any kind of link. Without options (as shown here), it makes a real link. With -s it makes a symlink. >> My question is: what is the "nl" command under FreeBSD used for? I guess >> "cat -n" would give the results I'm looking for but what happend to nl >> (number lines)? > > I dont know what "nl" is but I believe you want "wc" which is part of the > POSIX.2 standard. Man wc. He doesn't want to count, he wants to number the lines: $ ls -ld ssh-* drwx------ 2 grog wheel 512 Dec 23 2000 ssh-Bag65123 drwx------ 2 grog wheel 512 Aug 7 15:14 ssh-Glhlk257 drwx------ 2 grog wheel 512 Oct 13 10:27 ssh-Ixp28173 drwx------ 2 grog wheel 512 Mar 27 2001 ssh-OgRDn294 drwx------ 2 grog wheel 512 Oct 10 09:57 ssh-URj82414 drwx------ 2 grog wheel 512 Aug 7 13:46 ssh-XjbEI258 drwx------ 2 grog wheel 512 Feb 6 2001 ssh-YURJo276 drwx------ 2 grog wheel 512 Aug 12 2000 ssh-ata89580 drwx------ 2 grog wheel 512 Oct 12 11:15 ssh-hUi74003 drwx------ 2 grog wheel 512 Aug 19 12:18 ssh-iGjNg246 drwx------ 2 grog wheel 512 Dec 26 2000 ssh-kBg82553 drwx------ 2 grog wheel 512 Sep 22 15:04 ssh-kTIcf250 drwx------ 2 grog wheel 512 Oct 15 11:01 ssh-voH53612 $ ls -ld ssh-* | gnl 1 drwx------ 2 grog wheel 512 Dec 23 2000 ssh-Bag65123 2 drwx------ 2 grog wheel 512 Aug 7 15:14 ssh-Glhlk257 3 drwx------ 2 grog wheel 512 Oct 13 10:27 ssh-Ixp28173 4 drwx------ 2 grog wheel 512 Mar 27 2001 ssh-OgRDn294 5 drwx------ 2 grog wheel 512 Oct 10 09:57 ssh-URj82414 6 drwx------ 2 grog wheel 512 Aug 7 13:46 ssh-XjbEI258 7 drwx------ 2 grog wheel 512 Feb 6 2001 ssh-YURJo276 8 drwx------ 2 grog wheel 512 Aug 12 2000 ssh-ata89580 9 drwx------ 2 grog wheel 512 Oct 12 11:15 ssh-hUi74003 10 drwx------ 2 grog wheel 512 Aug 19 12:18 ssh-iGjNg246 11 drwx------ 2 grog wheel 512 Dec 26 2000 ssh-kBg82553 12 drwx------ 2 grog wheel 512 Sep 22 15:04 ssh-kTIcf250 13 drwx------ 2 grog wheel 512 Oct 15 11:01 ssh-voH53612 Greg -- See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message