I was recently searching for a way to filter out 'Permission denied' errors while searching for a file using the find command, and I found this link:
Here's an the answer that worked for me from the link:
find . -name "filename" 2>&1 | grep -v 'permission denied'
Although this answer works, I don't fully understand why we need the 2>&1 (redirection of stderr to stdout).
Doesn't the output from the command
find . -name "filename" | grep -v 'Permission denied' already redirect to stdout?