Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 9
    du -sh * starts throwing "unknown option" errors if any of the files in that dir begin with a dash. Safer to do du -sh -- * Commented Mar 1, 2016 at 23:07
  • 2
    du -sh * doesn't show memory usages of hidden folders Commented Oct 18, 2016 at 13:00
  • 11
    du -sh -- * .* to include dotfiles. This is useful to include a possibly large .git directory, for example. Alternatively in zsh you can setopt globdots to glob dotfiles by default. Commented Nov 29, 2016 at 3:13
  • 5
    What does the -- do? I know it applies to shell built-ins to end option arguments, but du is not a built-in, and I don't see this usage documented for du: linux.die.net/man/1/du Commented Jan 10, 2019 at 5:16
  • 10
    (--) is used in most bash built-in commands and many other commands to signify the end of command options, after which only positional parameters are accepted. source Commented Jun 3, 2020 at 11:47