From owner-freebsd-questions@FreeBSD.ORG Sat Apr 2 17:30:46 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBD88106566C for ; Sat, 2 Apr 2011 17:30:46 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 46F3A8FC0C for ; Sat, 2 Apr 2011 17:30:45 +0000 (UTC) Received: by bwz12 with SMTP id 12so3922750bwz.13 for ; Sat, 02 Apr 2011 10:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=nbF+pXB2R8RH4BD54D1+UBwsZf2RXfucQmDGIhesnX8=; b=ZANYin1smokhbhWkhUxQ+5JUO2xQELQExeyMCf2/q9H1T2MWzGD2/5U8tJIfqCDyXn PvJJlp8gRAWdyHQsw7yAbMYMDITTIWwI0En6pLYg418w25Q5+Ci1xSgn5naXBJbrrULt KnLokSQCoQb67qtihLcUzrF+DDDCl9NU2R+kM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=gmqryWKj0TJjcuMqM7PKwRQeb+pzvklgo4Elhs3G/QvyWkCtWlSOqyOgiKwYLj6pfI 6CXL+Jj8aHow/K2Ka7XAQHwyzev1kyqX692MUauU1vkQekUsxNYx8LMBNTJYvWHVJ3yr 3ne/EbAjrsHZY9+oYpIEcWkT6wRawc4nZBA9M= Received: by 10.204.18.193 with SMTP id x1mr1235774bka.79.1301765445114; Sat, 02 Apr 2011 10:30:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.205.64.142 with HTTP; Sat, 2 Apr 2011 10:30:15 -0700 (PDT) In-Reply-To: References: <0DD2BF5C-7387-4AFA-BF43-B1683F3773E8@d3photography.com> <20110402130739.4253ea30@napoleon> From: Chris Rees Date: Sat, 2 Apr 2011 18:30:15 +0100 Message-ID: To: Mike Jeays Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: graphical representation of `du` X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: utisoft@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Apr 2011 17:30:46 -0000 On 2 April 2011 18:22, Chris Rees wrote: > On 2 April 2011 18:07, Mike Jeays wrote: >> On Sat, 2 Apr 2011 17:15:04 +0100 >> Chris Rees wrote: >> >>> du -h . | awk '{a[i++]=3D$0} END {for (j=3Di-1; j>=3D0;) print a[j--] }= ' | >>> awk '{print($2" ["$1"]");}' | sed -e 's,[^-][^/]*/,--,g' -e 's,^,|,' >> >> >> I confess to being impressed... >> > > Yeah, but perhaps I should have used sed instead of the second awk; > fewer processes: > > du -h | awk '{a[i++]=3D$0} END {for (j=3Di-1; j>=3D0;) print a[j--] }' | = sed > -e 's,^[^1-9]*\([^___CTRL-V+TAB______]*\)____CTRL-V+TAB_____*\(.*\)$,\2 > \[\1\],;s,[^-][^/]*/,--,g;s,^,|,' > > That does exactly the same -- =A0where I've put ____CTRL-V+TAB______ you > have to type Ctrl-V, then a literal [::tab::] key; BSD sed doesn't do > \t. > > Chris > Final version: http://www.bayofrum.net/~crees/graphical_du.sh Maybe I should port it... Chris