Skip to main content
added 331 characters in body
Source Link
smac89
  • 1.7k
  • 1
  • 18
  • 18

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

find -type f -mtime +60 -print0 | xargs -0 du -ch | tail -n1

The above also works with files with spaces and newlines in their names, but may not work well if there are too many files found by find command. See the below comment. If you feel that there may be too many files, you can try the other answer on this page.

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

find -type f -mtime +60 -print0 | xargs -0 du -ch | tail -n1

The above also works with files with spaces and newlines in their names

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

find -type f -mtime +60 -print0 | xargs -0 du -ch | tail -n1

The above also works with files with spaces and newlines in their names, but may not work well if there are too many files found by find command. See the below comment. If you feel that there may be too many files, you can try the other answer on this page.

added 16 characters in body
Source Link
smac89
  • 1.7k
  • 1
  • 18
  • 18

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

du -ch $(find -type f -mtime +60) -print0 | xargs -0 du -ch | tail -n1

The above also works with files with spaces and newlines in their names

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

du -ch $(find -type f -mtime +60) | tail -n1

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

find -type f -mtime +60 -print0 | xargs -0 du -ch | tail -n1

The above also works with files with spaces and newlines in their names

deleted 9 characters in body
Source Link
smac89
  • 1.7k
  • 1
  • 18
  • 18

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

du -ch $(find -type f -mtime +60 -exec du -ch {} \+) | tail -n1

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

find -type f -mtime +60 -exec du -ch {} \+ | tail -n1

Try pipe the output of find to du and specify the --files0-from - flag:

find -type f -mtime +60 -print0 | du -shc --files0-from -

This should give you a grand total at the end

To get just the total, pipe that output to tail -n1:

find -type f -mtime +60 -print0 | du -shc --files0-from - | tail -n1

I should mention that I actually just tested this with gnu linux, not busybox. Looking at the busybox page, it does not look like du supports the --files0-from option.

You can change the above command to this to have it work on busybox:

du -ch $(find -type f -mtime +60) | tail -n1
added 10 characters in body
Source Link
smac89
  • 1.7k
  • 1
  • 18
  • 18
Loading
added 310 characters in body
Source Link
smac89
  • 1.7k
  • 1
  • 18
  • 18
Loading
Source Link
smac89
  • 1.7k
  • 1
  • 18
  • 18
Loading