linux - Supressing 'Permission Denied' warning in du command -


this question has answer here:

i want list size of sub-folders in directory. when try du -h --max-depth=1 output cluttered 'permission denied' statements such

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

how can suppress these warnings?

i tried workaround piping the output grep follows

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

but not seem working either!

try:

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

this redirects stderr (file handle 2) /dev/null, ignoring error messages.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -