Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

453
Views
Supressing 'Permission Denied' warning in du command

I want to list the size of all sub-folders in a directory. when I try du -h --max-depth=1 the output is cluttered with 'Permission denied' statements as such

du: cannot read directory `./folder_name': Permission denied

How can I suppress these warnings?

I tried a workaround by piping the the output to grep as follows

du -h --max-depth=1 | grep -v 'du:'

but that does not seem to be working either!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Try:

$ du -h --max-depth=1 2>/dev/null

This redirects stderr (file handle 2) to /dev/null, ignoring any error messages.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!