Skip to main content
added 73 characters in body
Source Link
rudimeier
  • 10.8k
  • 2
  • 35
  • 46

This is a common problem that command lines are not unlimited in size and number of arguments. A common way to get around these limits it to use find / xargs pipes.

Your case should work like this:

 findsudo sh -c "find . -mindepth 1 -maxdepth 1 -print0 |xargs -0 sudo du -hsx -- " |sort -rh |head

sudo requirement makes it look a bit more tricky than usual.

This is a common problem that command lines are not unlimited in size and number of arguments. A common way to get around these limits it to use find / xargs pipes.

Your case should work like this:

 find . -mindepth 1 -maxdepth 1 -print0 |xargs -0 sudo du -hsx -- |sort -rh |head

This is a common problem that command lines are not unlimited in size and number of arguments. A common way to get around these limits it to use find / xargs pipes.

Your case should work like this:

 sudo sh -c "find . -mindepth 1 -maxdepth 1 -print0 |xargs -0 du -hsx -- " |sort -rh |head

sudo requirement makes it look a bit more tricky than usual.

Source Link
rudimeier
  • 10.8k
  • 2
  • 35
  • 46

This is a common problem that command lines are not unlimited in size and number of arguments. A common way to get around these limits it to use find / xargs pipes.

Your case should work like this:

 find . -mindepth 1 -maxdepth 1 -print0 |xargs -0 sudo du -hsx -- |sort -rh |head