I'm trying to execute the following command: find . -name ".[ch]" | xargs grep -in pattern > file
There are some errors that are printed on stderr because a few files are not found. How can I redirect stdout to a file and stderr to /dev/null/ in the same command?
This command didn't work: find . -name ".[ch]" | xargs grep -in pattern 1> file 2> /dev/null/
The error message: ksh: /dev/null/: cannot create [Is a directory]
Can anyone tell me how I can do this?
Cheers, VSN