How to Exclude All “Permission denied” messages When Using Find Command?

How to Exclude All “Permission denied” messages When Using Find Command in UNIX/LINUX? use 2>/dev/null

The 2>/dev/null at the end of the find command tells your shell to redirect the standard error messages to /dev/null, so you won’t see them on screen. “/dev/null” is a virtual device file, Whatever you write to “/dev/null” will be discarded by the system.

Find command syntax

find {file_path} -type f -iname {file_pattern}

To discard the error “Permission Denied”

find infa/bdm/server/source/path -type f -iname "source_fname_*.txt" 2>&1 | grep -v "Permission denied"

To discard all type of error

find infa/bdm/server/source/path -type f -iname "source_fname_*.txt" 2>/dev/null

 

Search tags!
How to Exclude All “Permission denied” messages When Using Find Command?
How to skip “permission denied” errors when running find command in Linux/Unix?
Linux / Unix Find Command how to Avoid Permission Denied Messages
How to resolve permission denied Linux error in find command?