From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 04:25:00 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00DD7106566C for ; Fri, 5 Feb 2010 04:25:00 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.freebsd.org (Postfix) with ESMTP id A64F78FC12 for ; Fri, 5 Feb 2010 04:24:59 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so377982qwd.7 for ; Thu, 04 Feb 2010 20:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=1uep3KX5X3nSlFcyJHNzUNJx2j08OBcJQAOMi8TnmYM=; b=IyrOY09st2xMfwGtqPSKafWbkzVprNP+6HPfFpnTOHCdzQUiB0EChWNi6r1ppPItvB HHHnWwXfq0DKkOXlv02yJQGF9JhVW6OdRQl8Q42Ev32bm3+TbVpHnv4O0X6glIjW9FK6 1ZlXvSWaI5adY4iE1ZSdYFMvP2vSOAAxtInoI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=rUME8IXQSq8bmqjdVaXn69aYh/OLajk2dpAay3cP+dTHUIB0y7S57cubCHkQxnpn1E Ydvuw4q/VgZiLith4hbImBzwNZzPhlv6eN3Q0NeEuvuhDKfWtlIbJLh861UkFQ1BxAC7 t+vV2a0zWqA8KnbJVib/CXU3kut6ZwsGivln0= Received: by 10.224.54.198 with SMTP id r6mr115863qag.383.1265343898903; Thu, 04 Feb 2010 20:24:58 -0800 (PST) Received: from centel.dataix.local (ppp-21.112.dialinfree.com [209.172.21.112]) by mx.google.com with ESMTPS id 5sm3080463qwg.58.2010.02.04.20.24.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 20:24:57 -0800 (PST) Sender: "J. Hellenthal" Date: Thu, 4 Feb 2010 23:24:51 -0500 From: jhell To: Gleb Kurtsou In-Reply-To: <20100204115505.GA5272@tops.skynet.lt> Message-ID: References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Ed Schouten , Xin LI , FreeBSD Hackers Subject: Re: [PATCH] Support for thresholds in du(1) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Feb 2010 04:25:00 -0000 On Thu, 4 Feb 2010 06:55, gleb.kurtsou@ wrote: > On (25/02/2009 17:24), Mel wrote: >> Hi, >> >> attached is a small patch to add threshold support to du(1). I've been using >> it on 7-STABLE machines for a while, cause I got tired of the noise I get >> when sorting and then reformatting to human-readable. Especially since >> sorting isn't part of the equasion "I'd like to see all dirs exceeding a >> given size". >> I've not updated the manpage on -STABLE yet, should be the same as HEAD. >> >> Example usage: >> # du -xht 20m . >> 29M ./contrib/binutils >> 52M ./contrib/gcc >> 237M ./contrib >> 35M ./crypto >> 28M ./lib >> 20M ./share >> 55M ./sys/dev >> 139M ./sys >> 545M . >> >> I'll file a PR for it, if there's no objections to this feature / >> implementation, the style(9) or the usage of -t. >> -- >> Mel > > Hi, > > I've cleaned up original patch: > * fixed style and some bugs > * as suggested changed it to use expand_number > * implemented support for negative threshold values > > I find the patch very useful. Does it look ok to be commited, or should > I file a PR so it won't get lost once again. > > Example usage: > src/sys/crypto % du -ht 100k > 137K ./des > 482K . > src/sys/crypto % du -A -ht +100k > 129K ./des > 446K . > src/sys/crypto % du -ht -100k > 56K ./camellia > 11K ./salsa20 > 38K ./sha2 > 9.0K ./rc4 > 68K ./des/arch/i386 > 70K ./des/arch > 88K ./rijndael > 37K ./via > 8.0K ./hmac > 36K ./blowfish/arch/i386 > 37K ./blowfish/arch > 85K ./blowfish > Also not to be picky but I can see this being raised in another email at a later time. For Each du -ht +1.5{M,G,T,P} Would be something nice to compliment this so you do not have to revert back to say "1440k" when wanting to say 1.5m and so on for larger sizes. Also I think to be fully supportive it should have the capability to do at the least -N bits & +-N bytes. Thanks for the work that you have done on this. -- jhell