Skip to main content
2 of 2
added 73 characters in body
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:

 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.

rudimeier
  • 10.8k
  • 2
  • 35
  • 46