Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Oct 2001 11:52:21 +0930
From:      Greg Lehey <grog@FreeBSD.org>
To:        scanner@jurai.net
Cc:        Scott Gerhardt <scott@gerhardt-it.com>, FreeBSD <freebsd-questions@FreeBSD.ORG>
Subject:   Re: "nl" command
Message-ID:  <20011015115221.H69347@wantadilla.lemis.com>
In-Reply-To: <Pine.BSF.4.21.0110142212300.47683-100000@sasami.jurai.net>; from scanner@jurai.net on Sun, Oct 14, 2001 at 10:18:19PM -0400
References:  <KPEMLBLEMPMHGLJOCDEGCEABCKAA.scott@gerhardt-it.com> <Pine.BSF.4.21.0110142212300.47683-100000@sasami.jurai.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011015115221.H69347>