Shell Scripting / Bash Tricks
Stop find from gagging on permissions errors
đź§© The Challenge
Trying to hunt down a specific config file across a massive partition often leads to a wall of red “Permission denied” text. It buries the actual results I’m trying to find and makes me want to throw my keyboard.
đź’ˇ The Fix
You can redirect the standard error stream directly to /dev/null, which keeps your terminal clean and shows you exactly what you asked for. It’s a lifesaver when you’re running stuff as a non-root user.
find / -name "my-config.yaml" 2>/dev/null
⚙️ Why It Works
By tagging 2>/dev/null onto the end, you’re telling the shell to throw all those annoying error messages into the void instead of printing them to your screen. This leaves the standard output channel completely clear for your results.
🚀 Pro-Tip: Add -print to your find command if you’re chaining it with xargs later to avoid surprises.
Linux Tips & Tricks | © ngelinux.com | 8/9/2026
