On Tue, Jun 04, 2024 at 04:40:07PM +0200, Franco Martelli wrote:
> FYI the revision of duhs() I adopt is:
>
> duhs() { ( shopt -s dotglob; printf '%s\0' "${1:-.}" "${1:-.}"*/ | xargs -0
> du -shl ) }↑
>
> Please note that I dropped a "/" in the "${1
On 04/06/24 at 03:48, Greg Wooledge wrote:
On Mon, Jun 03, 2024 at 07:42:17PM -0500, David Wright wrote:
On Mon 03 Jun 2024 at 18:29:17 (-0400), Greg Wooledge wrote:
‘-s’
‘--summarize’
Display only a total for each argument.
There's supposed to be a total *FOR EACH ARGUMENT*. There isn'
On Mon, Jun 03, 2024 at 07:42:17PM -0500, David Wright wrote:
> On Mon 03 Jun 2024 at 18:29:17 (-0400), Greg Wooledge wrote:
> > ‘-s’
> > ‘--summarize’
> > Display only a total for each argument.
> >
> > There's supposed to be a total *FOR EACH ARGUMENT*. There isn't.
>
> Try adding -l. The
On Mon 03 Jun 2024 at 18:29:17 (-0400), Greg Wooledge wrote:
> On Mon, Jun 03, 2024 at 10:45:28PM +0200, Franco Martelli wrote:
> > On 03/06/24 at 16:32, Greg Wooledge wrote:
> > > duhs() {
> > > (
> > >shopt -s dotglob
> > >printf '%s\0' "${1:-.}"/*/ | xargs -0 du -sh
> > >
On Mon 03 Jun 2024 at 15:03:37 (-0400), Greg Wooledge wrote:
> On Mon, Jun 03, 2024 at 01:11:57PM -0500, David Wright wrote:
> > On Mon 03 Jun 2024 at 10:32:16 (-0400), Greg Wooledge wrote:
> > > duhs() (
> > > shopt -s dotglob
> > > printf '%s\0' "${1:-.}"/*/ | xargs -0 du -sh
> > > )
> >
On Mon, Jun 03, 2024 at 10:45:28PM +0200, Franco Martelli wrote:
> On 03/06/24 at 16:32, Greg Wooledge wrote:
> > duhs() {
> > (
> >shopt -s dotglob
> >printf '%s\0' "${1:-.}"/*/ | xargs -0 du -sh
> > )
> > }
>
> I've some issue with this function. It doesn't show the siz
On 03/06/24 at 16:36, Andy Smith wrote:
unbuffer tree --du -Fah /usr/local | grep /$
If that's the only thing you're using unbuffer for, why not just use
the -C option of tree? It's a bit like the "--color=always" of ls.
Yeah, RTFMB4 I've all the "aliases" with the "unbuffer" command…
Cheer
On 03/06/24 at 16:32, Greg Wooledge wrote:
duhs() {
shopt -s dotglob
printf '%s\0' "${1:-.}"/*/ | xargs -0 du -sh
shopt -u dotglob
}
But this assumes that the option was*not* already on when we entered
the function. If it was on, we've just turned it off. Another way to
do this
On Mon, Jun 03, 2024 at 01:11:57PM -0500, David Wright wrote:
> On Mon 03 Jun 2024 at 10:32:16 (-0400), Greg Wooledge wrote:
> > duhs() (
> > shopt -s dotglob
> > printf '%s\0' "${1:-.}"/*/ | xargs -0 du -sh
> > )
> >
> > I'm not personally fond of this. It's extremely easy to overlook
>
On Mon 03 Jun 2024 at 10:32:16 (-0400), Greg Wooledge wrote:
> I'll also throw in one last piece of information because if I don't,
> someone else is likely to do it, without a good explanation.
> Syntactically, the body of a shell function doesn't have to be enclosed
> in curly braces. The body c
On Mon, Jun 03, 2024 at 02:36:43PM +, Andy Smith wrote:
[...]
> If that's the only thing you're using unbuffer for, why not just use
> the -C option of tree? It's a bit like the "--color=always" of ls.
Oh, and the complementary option for `less', while we're at it, would
be -R:
tree -C |
Hi,
On Mon, Jun 03, 2024 at 03:52:54PM +0200, Franco Martelli wrote:
> "tree" detects that its std output goes through a pipe and
> therefore it disables the escaped code to colorize (like also
> "dmesg" does). To avoid this behavior you must use the "unbuffer"
> command:
>
> unbuffer tree --du -
On Mon, Jun 03, 2024 at 03:52:54PM +0200, Franco Martelli wrote:
> On 31/05/24 at 22:03, Greg Wooledge wrote:
> > > It could be improved adding the "-a" switch to show also the hidden
> > > directories and the "--color" switch to the "grep" command but this sadly
> > > doesn't show the expected res
On Mon, Jun 03, 2024 at 03:52:54PM +0200, Franco Martelli wrote:
> > >
> > > ~$ tree --du -Fah /tmp/x | grep --color /$
> > You're only coloring the trailing / characters. If you want everything
> > from after the last space to the end of the line, you'd want:
> >
> > tree --du -Fh /usr/loc
Hi Greg,
(sorry for the answer's late but I turn off the PC during the weekend) :(
On 31/05/24 at 22:03, Greg Wooledge wrote:
It could be improved adding the "-a" switch to show also the hidden
directories and the "--color" switch to the "grep" command but this sadly
doesn't show the expected re
On Fri, May 31, 2024 at 11:18 PM Greg Wooledge wrote:
>
> On Fri, May 31, 2024 at 09:35:59PM -0500, David Wright wrote:
> > If a coloured ] is unimportant, I suppose you could use:
> >
> > tree --du -Fh whatever | grep --color '][[:space:]][[:space:]].*/$'
>
> You don't need to count spaces. Jus
On Fri, May 31, 2024 at 09:35:59PM -0500, David Wright wrote:
> If a coloured ] is unimportant, I suppose you could use:
>
> tree --du -Fh whatever | grep --color '][[:space:]][[:space:]].*/$'
You don't need to count spaces. Just '].*/$' would suffice. We already
know we want to start with th
On Fri 31 May 2024 at 16:03:22 (-0400), Greg Wooledge wrote:
> On Fri, May 31, 2024 at 09:18:03PM +0200, Franco Martelli wrote:
> > On 31/05/24 at 02:18, Greg Wooledge wrote:
> > > Confusing and useless. I still don't have a better answer than this:
> > >
> > > hobbit:~$ tree --du -Fh /tmp/x | gr
On Fri, May 31, 2024 at 09:18:03PM +0200, Franco Martelli wrote:
> On 31/05/24 at 02:18, Greg Wooledge wrote:
> > Confusing and useless. I still don't have a better answer than this:
> >
> > hobbit:~$ tree --du -Fh /tmp/x | grep /$
> > [7.8M]/tmp/x/
> > └── [4.0K] y/
>
> It could be improved ad
On 31/05/24 at 02:18, Greg Wooledge wrote:
Confusing and useless. I still don't have a better answer than this:
hobbit:~$ tree --du -Fh /tmp/x | grep /$
[7.8M]/tmp/x/
└── [4.0K] y/
It could be improved adding the "-a" switch to show also the hidden
directories and the "--color" switch to th
Northwind composed on 2024-05-31 06:28 (UTC+0800):
> is there a command that shows dir/subdir structure like `tree`, but for
> each dir has the size in results as well?
Is ncdu any use to your need?
--
Evolution as taught in public schools is, like religion,
based on faith, not based on
On Thu, May 30, 2024 at 08:04:26PM -0400, e...@gmx.us wrote:
> > > It looks like "tree --du" should do it, but "tree -d --du -h" says
> > > ├── [452K] Documents
> I think "du -h -S -s Documents/" gives just the files in Documents, and not
> its subdirectories, and it gives 269M. "ls -ldh Document
On 5/30/24 18:54, Greg Wooledge wrote:
On Thu, May 30, 2024 at 06:51:30PM -0400, e...@gmx.us wrote:
It looks like "tree --du" should do it, but "tree -d --du -h" says
├── [452K] Documents
when du says it's 787M.
Well, that sounds like one of the numbers includes subdirectories and
the other
On Fri, May 31, 2024 at 06:57:27AM +0800, Northwind wrote:
> both the size of current path and subdir should be expected.
According to the man page, that's what it does.
I just installed tree and tried it. There's a subtle behavior that I
did not expect:
hobbit:/usr/local$ tree -d --du -h
[3.9M
both the size of current path and subdir should be expected.
thanks.
The question is: which one do you want?
On Thu, May 30, 2024 at 06:51:30PM -0400, e...@gmx.us wrote:
> It looks like "tree --du" should do it, but "tree -d --du -h" says
>
> ├── [452K] Documents
>
> when du says it's 787M.
Well, that sounds like one of the numbers includes subdirectories and
the other only includes files in the immed
On 5/30/24 18:28, Northwind wrote:
Hello,
is there a command that shows dir/subdir structure like `tree`, but for each
dir has the size in results as well?
It looks like "tree --du" should do it, but "tree -d --du -h" says
├── [452K] Documents
when du says it's 787M.
--
When we've nuked th
27 matches
Mail list logo