Supresss the 'no such file or directory' message from 'find'

I'm trying to find a directory with this command:

find /users/dan/ -name 'Prams' -type d

I see a huge amount of 'No such file or directory' output. Is there a way to make find shut up if it doesn't find anything?


Solution 1:

Try this:

find /users/dan/ -name 'Prams' -type d 2>/dev/null

Solution 2:

You can suppress the STDERR output:

find /users/dan/ -name 'Prams' -type d 2> /dev/null

Or you can use find to show all directories and filter its output with grep:

find /users/dan -type d | grep "Prams"

The find command won't print "no such file or directory" if the search path (/users/dan, in this case) exists, even if there are no matches. Are you sure this directory exists?