title: Exclude all permission denied messages from "du"
body: <p>I am trying to evaluate the disk usage of a number of Unix user accounts.
  Simply, I am using the following command:</p>
  
  <pre><code>du -cBM --max-depth=1 | sort -n
  </code></pre>
  
  <p>But I’ve seen many error message like below. How can I exclude all such “Permission denied” messages from display?</p>
  
  <pre><code>du: `./james/.gnome2': Permission denied
  </code></pre>
  
  <p><strong>My request could be very similar to the following list, by replacing “find” to “du”.</strong></p>
  
  <p><a href="https://stackoverflow.com/q/762348">How can I exclude all &quot;permission denied&quot; messages from &quot;find&quot;?</a></p>
  
  <p>The following thread does not work. I guess I am using bash.</p>
  
  <p><a href="https://stackoverflow.com/q/5463884">Excluding hidden files from du command output with --exclude, grep -v or sed</a></p>