General discussion

Locked

unix "find" command

By stevelil ·
Is there a way to suppress the unwanted output from the find command:

find: cannot open /..............
find: cannot open /..............
find: cannot open /..............

and just see the files found ?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

unix "find" command

by cpfeiffe In reply to unix "find" command

There are many ways to do this, but I think you would benefit most in the long run by doing some redirections that will be useful in many other events

try your find command and at the end of the line add

2>/dev/null

This will send standard error to /dev/null. The default is your console. 2 represents standard error in the shell, 1 is standard out and 0 is standard in. You can redirect either like this. If you want to redirect both standard out and standard error (useful in many occassions, but not yours) to /dev/null you could

command >/dev/null 2>&1
This sends standard out to /dev/null. When you don't specify anything standard out is assumed. The trailing '2>&1' is basically sending 2 (standard error) to the same place as 1 (standard out).

I hope this is helpful.

Collapse -

unix "find" command

by stevelil In reply to unix "find" command

Poster rated this answer

Collapse -

unix "find" command

by roger.gibson In reply to unix "find" command

You can be root user if you brave enough!

Collapse -

unix "find" command

by stevelil In reply to unix "find" command

Poster rated this answer

Collapse -

unix "find" command

by stevelil In reply to unix "find" command

This question was closed by the author

Back to Linux Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums