Re: Feature Request: du --dir-with-slash

2008-03-12 Thread Thomas Guettler
Jim Meyering schrieb: > Pádraig Brady <[EMAIL PROTECTED]> wrote: > >> Thomas Guettler wrote: >> >>> Thank you for being interested. I wrote a patch which makes the slash >>> optional: >>> >>> src/du --help: >>> ... >>> -z, --dir-with-slash append a slash to directories. >>> >> I

Re: Feature Request: du --dir-with-slash

2008-03-10 Thread Pádraig Brady
Pádraig Brady wrote: > find / -xdev -printf "%p%y\n" | > sed 's/d$/\//;t; s/.$//;' | > tr '\n' '\0' | > xargs -r0 du -s | > LC_ALL=C sort -rn -k1,1 Note that will give the output you want but will be very inefficient :( So Jim's method is the best compromise for the moment. Pádraig. ___

Re: Feature Request: du --dir-with-slash

2008-03-10 Thread Jim Meyering
Thomas Guettler <[EMAIL PROTECTED]> wrote: >>> I'm very dubious about adding this as an option. >>> Do you really think an option is warranted for this, >>> considering you can already get the desired behavior >>> with a small wrapper, as I demonstrated: >> >> The wrapper is awkward, but it's bette

Re: Feature Request: du --dir-with-slash

2008-03-10 Thread Thomas Guettler
>> I'm very dubious about adding this as an option. >> Do you really think an option is warranted for this, >> considering you can already get the desired behavior >> with a small wrapper, as I demonstrated: >> > > The wrapper is awkward, but it's better than a new option. > > So probably bes

Re: Feature Request: du --dir-with-slash

2008-03-10 Thread Thomas Guettler
Pádraig Brady schrieb: > Thomas Guettler wrote: > >> Hi, >> >> I use "du -ax / | sort -rn > /var/tmp/du-`date --iso`" to get the sorted >> total size of all >> files and directories. >> >> Unfortunately you can't see a difference between a directory and a file >> in the output. It would be nice

Re: Feature Request: du --dir-with-slash

2008-03-10 Thread Pádraig Brady
Thomas Guettler wrote: >>> I'm very dubious about adding this as an option. >>> Do you really think an option is warranted for this, >>> considering you can already get the desired behavior >>> with a small wrapper, as I demonstrated: >>> >> The wrapper is awkward, but it's better than a new o

Re: Feature Request: du --dir-with-slash

2008-03-10 Thread Pádraig Brady
Jim Meyering wrote: > Pádraig Brady <[EMAIL PROTECTED]> wrote: >> Thomas Guettler wrote: >>> Thank you for being interested. I wrote a patch which makes the slash >>> optional: >>> >>> src/du --help: >>> ... >>> -z, --dir-with-slash append a slash to directories. >> I don't think it's worth an

Re: Feature Request: du --dir-with-slash

2008-03-10 Thread Jim Meyering
Pádraig Brady <[EMAIL PROTECTED]> wrote: > Thomas Guettler wrote: >> Thank you for being interested. I wrote a patch which makes the slash >> optional: >> >> src/du --help: >> ... >> -z, --dir-with-slash append a slash to directories. > > I don't think it's worth an option TBH. > How about we d

Re: Feature Request: du --dir-with-slash

2008-03-10 Thread Pádraig Brady
Thomas Guettler wrote: > Pádraig Brady schrieb: >> Thomas Guettler wrote: >> >>> Hi, >>> >>> I use "du -ax / | sort -rn > /var/tmp/du-`date --iso`" to get the sorted >>> total size of all >>> files and directories. >>> >>> Unfortunately you can't see a difference between a directory and a file >

Re: Feature Request: du --dir-with-slash

2008-03-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Pádraig Brady on 3/7/2008 10:01 AM: | | So does that mean we should be stripping trailing / | from directories that are specified? | | $ du -s /tmp | 8040/tmp | | I think adding a / to all dirs is therefore more consistent | a

Re: Feature Request: du --dir-with-slash

2008-03-07 Thread Bauke Jan Douma
Pádraig Brady wrote on 07-03-08 18:01: I think adding a / to all dirs is therefore more consistent as well as providing more info to the user. I understand the need to comply with POSIX where possible, but one needs to use common sense to move forward. POSIX is not the be all and end all. That

Re: Feature Request: du --dir-with-slash

2008-03-07 Thread Pádraig Brady
Eric Blake wrote: > I don't think you can do it by default - it must be via an option. POSIX > states: > > ~The output from du shall consist of the amount of space allocated to a > file and the name of the file, in the following format: > > ~"%d %s\n", , > > http://www.opengroup.org/on

Re: Feature Request: du --dir-with-slash

2008-03-07 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Pádraig Brady on 3/7/2008 8:46 AM: |> Unfortunately you can't see a difference between a directory and a file |> in the output. It would be nice if the directories would be added by a |> slash. | | How about the attaced patch? I don't th

Re: Feature Request: du --dir-with-slash

2008-03-07 Thread Pádraig Brady
Thomas Guettler wrote: > Hi, > > I use "du -ax / | sort -rn > /var/tmp/du-`date --iso`" to get the sorted > total size of all > files and directories. > > Unfortunately you can't see a difference between a directory and a file > in the output. It would be nice if the directories would be added by

Re: Feature Request: du --dir-with-slash

2008-03-06 Thread Pádraig Brady
Thomas Guettler wrote: > Hi, > > I use "du -ax / | sort -rn > /var/tmp/du-`date --iso`" to get the sorted > > Unfortunately you can't see a difference between a directory and a file > in the output. It would be nice if the directories would be added by a > slash. > > This way you can see if a li

Re: Feature Request: du --dir-with-slash

2008-03-06 Thread Jim Meyering
Thomas Guettler <[EMAIL PROTECTED]> wrote: > I use "du -ax / | sort -rn > /var/tmp/du-`date --iso`" to get the sorted > total size of all > files and directories. > > Unfortunately you can't see a difference between a directory and a file > in the output. It would be nice if the directories would b