From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 5 10:58:15 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 C1CF11065676 for ; Fri, 5 Feb 2010 10:58:15 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f211.google.com (mail-ew0-f211.google.com [209.85.219.211]) by mx1.freebsd.org (Postfix) with ESMTP id 5050E8FC14 for ; Fri, 5 Feb 2010 10:58:14 +0000 (UTC) Received: by ewy3 with SMTP id 3so1354661ewy.13 for ; Fri, 05 Feb 2010 02:58:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=D1RZYsRMHWIQmL0iOjy/v4nuu/qKwNCWFprjTq0x29w=; b=EWIWF0hKs0/sy3RuLv6j2zhbYVWTKxY2U4DIGc4yMw/SjriHnH6Z1qKaajVXaPNoDg T/lbyTaqTMlDA3tjkOXJfsQpP/pLh9PN8KKif50//TZwXdImD00FEpqC0TKqUHZa5Xxc ttP23UKL/n935DY6G0XB+qzMo9VlfQm1IiJ3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=DZ04evblfmkZ7KjQdfMITb7AqO8PhXAdfsGcMH+aNnIJjmGfnY2cVqA+Xigtnaej2R iTMOOSAG0lXEhQSl8UHZ5FFI1v6SCLdUxUaNDrDZLyCbaHERAUvayJMyplWTm/s93zU0 WQPjoziRRbSYNETL7OfbISGGP8KmnACwf9z+A= Received: by 10.213.100.161 with SMTP id y33mr1046877ebn.27.1265367493378; Fri, 05 Feb 2010 02:58:13 -0800 (PST) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id 24sm4785932eyx.46.2010.02.05.02.58.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Feb 2010 02:58:12 -0800 (PST) Date: Fri, 5 Feb 2010 12:58:06 +0200 From: Gleb Kurtsou To: jhell Message-ID: <20100205105806.GB1786@tops.skynet.lt> References: <200902251724.40212.fbsd.hackers@rachie.is-a-geek.net> <20100204115505.GA5272@tops.skynet.lt> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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 10:58:15 -0000 On (04/02/2010 23:24), jhell wrote: > > 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. Let's keep it simple, these features are are not hard to implement, but overcomplicate such simple utility as du(1). If one needs more sophisticated disk usage reporting he's likely to have 3rd party utils installed already. > Thanks for the work that you have done on this. > > -- > > jhell >