Search code examples
shellio-redirectiondev-null

Send terminal output of software to file or /dev/null


I'm working with a program called Velvet (what we call an assembler in bioinformatics). This software doesn't come with a silent or quiet mode option and I have a script that runs it several times causing it to saturate my terminal with text that isn't really meaningful to me in that moment (about 100 lines of text are printed per iteration).

I have tried to send this output to /dev/null by doing this:

[Terminal@Session]$ velvet -option1 -option2 -file1 -file2 > /dev/null

However this causes the shell to complain about a segmentation fault and the software doesn't actually run at all. I feel like this is a syntax problem since trying to send the stuff to /dev/null like I did might interfere with the expected software syntax and hence the error appears. I can't seem to find a solution anywhere. Is there any other syntax I can use to redirect the output?


Solution

  • OP confirmed that my proposal in a comment worked, even without knowing why.
    You can redirect output to 'normal' files with

    velvet -option1 -option2 -file1 -file2 > /tmp/velvet1.out 2>/tmp/velvet2.out