Skip to content

Instantly share code, notes, and snippets.

@RellikJaeger
Created January 5, 2026 13:23
Show Gist options
  • Select an option

  • Save RellikJaeger/ec356a4afd57d7df4ddf81393c7ee4bb to your computer and use it in GitHub Desktop.

Select an option

Save RellikJaeger/ec356a4afd57d7df4ddf81393c7ee4bb to your computer and use it in GitHub Desktop.
Custom stderr-silent prefix function. Copy and paste this code into `~/.bashrc` or `~/.zshrc`, then run `source ~/.bashrc` or `source ~/.zshrc`.
# Custom stderr-silent prefix function
# Example: `_ find / -name pkgx`
# This will silence stderr in the output
_() {
# if first arg is "_", shift it
if [[ "$1" == "_" ]]; then
shift
fi
"$@" 2>/dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment