GNU bug report logs - #19849
RFE: du output uses undefined screen-tabsize: expand tabs to spaces or "-T<tabsize> option?"

Previous Next

Package: coreutils;

Reported by: Linda Walsh <coreutils <at> tlinx.org>

Date: Thu, 12 Feb 2015 21:19:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Linda Walsh <coreutils <at> tlinx.org>, 19849 <at> debbugs.gnu.org
Subject: bug#19849: RFE: du output uses undefined screen-tabsize: expand tabs to spaces or "-T<tabsize> option?"
Date: Mon, 4 Jan 2016 01:56:32 +0000
tag 19849 notabug
close 19849
stop

On 12/02/15 21:17, Linda Walsh wrote:
> I run a linux compat term that allows setting the tab size.
> Since most of my usage is using tabsize=2, I set the term's
> tabsize to such when it comes up.
> 
> Programs that can display tabs in output like
> 'ls', 'diff', 'less(or more)', to name a few, have some type of
> "expand-tabs" or "-[tT]" option to expand tabs on output
> (or input to line up input columns).
> 
> Ex:
> 
> ls:
>        -T, --tabsize=COLS
>               assume tab stops at each COLS instead of 8
> diff:
>        -t, --expand-tabs
>               expand tabs to spaces in output
>        -T, --initial-tab
>               make tabs line up by prepending a tab
>        --tabsize=NUM
>               tab stops every NUM (default 8) print columns
> (etc..).
> 
> I propose 'du' gain a "-T" option like 'ls' to allow for
> formatted output:
> 
> So instead of :
> 
> 20K My layouts/linda-default.fcl
> 20K My layouts/new-default.fcl
> 0 My layouts/foo.fcl

> I could see:
> 
> 20K     My layouts/linda-default.fcl
> 20K     My layouts/new-default.fcl
> 0       My layouts/foo.fcl

I think of the single tab output by du, as providing
standard separation, with very rough alignment.
One can then adjust alignment easily outside of of du.

For example:

$ du -h | expand
20K     My layouts/linda-default.fcl
20K     My layouts/new-default.fcl
0       My layouts/foo.fcl

Or more sophisticated right alignment and number processing with:

$ du -B1 *.patch | numfmt --format=%6.1f --to=iec
 20.0K My layouts/linda-default.fcl
 20.0K My layouts/new-default.fcl
   0.0 My layouts/foo.fcl

thanks,
Pádraig




This bug report was last modified 6 years and 211 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.