From owner-freebsd-arch Wed Mar 6 13:12:57 2002 Delivered-To: freebsd-arch@freebsd.org Received: from softweyr.com (softweyr.com [65.88.244.127]) by hub.freebsd.org (Postfix) with ESMTP id 1C30B37B400 for ; Wed, 6 Mar 2002 13:12:52 -0800 (PST) Received: from mail.dobox.com ([65.88.244.102] helo=softweyr.com) by softweyr.com with esmtp (Exim 3.35 #1) id 16iii2-000IlN-00; Wed, 06 Mar 2002 14:12:27 -0700 Message-ID: <3C862FD0.3040100@softweyr.com> Date: Wed, 06 Mar 2002 15:03:44 +0000 From: Wes Peters Organization: Softweyr LLC User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.8) Gecko/20020222 X-Accept-Language: en-us MIME-Version: 1.0 To: Nate Williams Cc: Alfred Perlstein , arch@FreeBSD.ORG Subject: Re: Sorting and Matching options for ls(1) References: <3C862030.9080108@softweyr.com> <20020306201842.GS77980@elvis.mu.org> <15494.32446.840336.843194@caddis.yogotech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Nate Williams wrote: > Alfred Perlstein writes: > >>* Wes Peters [020306 12:05] wrote: >> >>>At the request of several FreeBSD users, I have developed the following >>>two options for ls(1): >>> >>> -M Display files that match the specified types only. The file >>> types are specified by a single character as in strmode(3), >>> with >>> the option to specify regular files as ``r'' instead of ``-'' >>> if >>> needed. >>> >>> -S Explicity specify the sorting order. The sorting flags are: >>> >>EXAMPLES >> The following is how to do an ls listing sorted by size (and shows why ls >> does not need a separate option for this): >> >> ls -l | sort -n +4 >> > > Or, alternatively. > > ls -ls | sort > > And in reverse order > > ls -ls | sort -r Now make it do one (or either) and only display the filenames: bash-2.05$ ./ls -Ss /bin tcsh unlink cp test sleep csh rm chmod mkdir echo sh mv cat kill rmail ls red df link sync pax ed chio ln rcp expr realpath hostname ps dd pwd domainname date stty [ rmdir I made all the same arguments to the users who adamantly requested both, and was told resoundingly that resorting to a pipe with combinations of grep, sort, and awk was not acceptable. You could at least assume I know how to read a man page, and use sort and grep. Anyone else who want to raise the trivial argument "ls already has too many options" can simply reply directly to me with a subject of "ls: trivial argument". Spare the list traffic. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message