I am trying to run this dreadfully simple command in Bash
java -cp nasa-top-secret.jar gov.nasa.RocketToMoon | grep -v codehaus
but grep is not working (it does not filter out my string). How can I filter my java
output using grep
?
I am trying to run this dreadfully simple command in Bash
java -cp nasa-top-secret.jar gov.nasa.RocketToMoon | grep -v codehaus
but grep is not working (it does not filter out my string). How can I filter my java
output using grep
?
The output could be on STDERR, Try this instead:
java -cp nasa-top-secret.jar gov.nasa.RocketToMoon 2>&1 | grep -v codehaus
possible scenario
-v
stands for.possible troubleshooting step:
2>&1
at the end of the command
and try again with grep