From owner-freebsd-questions Tue Oct 20 01:27:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA21771 for freebsd-questions-outgoing; Tue, 20 Oct 1998 01:27:13 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from loviatar.webcom.com (loviatar.webcom.com [209.1.28.41]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA21761 for ; Tue, 20 Oct 1998 01:27:09 -0700 (PDT) (envelope-from graeme@echidna.com) Received: from eresh.webcom.com (eresh.webcom.com [209.1.28.49]) by loviatar.webcom.com (8.9.1/8.9.1) with SMTP id AAA19724; Tue, 20 Oct 1998 00:26:40 -0700 Received: from [199.183.207.48] by inanna.webcom.com (WebCom SMTP 1.2.1) with SMTP id 9860339; Tue Oct 20 01:24 PDT 1998 Message-Id: <362C7272.4F41@echidna.com> Date: Tue, 20 Oct 1998 04:22:26 -0700 From: Graeme Tait Organization: Echidna X-Mailer: Mozilla 2.02 (Win16; I) Mime-Version: 1.0 To: flygt@sr.se Cc: Bill Hamilton , FreeBSD Questions Subject: Re: alternate file listing References: <362B3923.2534A16A@graphnet.com> <362C58C1.B4D1367@pc.jaring.my> <362BB8A2.B27F615E@finsco.com> <19981020090701.A9920@sr.se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Gunnar Flygt wrote: > > On Mon, Oct 19, 1998 at 05:09:38PM -0500, Bill Hamilton wrote: > > like what directories? > > ls -lR | sort -k 5 > > will sort on on size from "." down. (at least on Solaris) > > That won't work well on neither FreeBSD nor Solaris. You get a sort, not > in filesize order, but on the first, second and son on digigt. At least > on the two different machines I checked. Yes - the action of sort in this case seems to depend on the column alignment, which for ls -l depends in turn on the width of the user and group names. Within a single directory, with say constant group and user names, the sort is in numeric order. It's worse with ls -lR, as the column alignment can additionally change from directory to directory, depending on the maximum file size in each directory. I found the sort man page rather confusing, but I believe from experiment that ls -lR | sort -nk 5 does work (FreeBSD). The resulting listing can look rather ugly, though. -- Graeme Tait - Echidna To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message