I'm using Python to execute some bash commands. The problem is that the terminal outputs from these bash scripts are spamming my terminal. Is there any way to block the output messages from these scripts? I have tried the step in this answer. But is only blocking the print
calls I make, and it is not blocking the console outputs from the bash commands.
Can anyone suggest any better solution?
Asked
Active
Viewed 56 times
0

brownser
- 545
- 7
- 25
-
Does this answer your question? https://stackoverflow.com/questions/18012930/how-can-i-redirect-all-output-to-dev-null – Igor Moraru Nov 24 '22 at 15:51
-
Does this answer your question? [How can I redirect all output to /dev/null?](https://stackoverflow.com/questions/18012930/how-can-i-redirect-all-output-to-dev-null) – Javad Nov 24 '22 at 15:53
-
1you have to show an example of your python code so people can see how you are invoking the bash scripts. There are ways of calling external processes redirecting their outputs, but people have to see your code so they can give you the correct hints. – jsbueno Nov 24 '22 at 16:03
1 Answers
0
In Bash you can simply use:
$ eclipse &>/dev/null
This catches both stdin and stderr to the redirect point (in bash). (here eclipse is my command like)

Kavya Kommuri
- 66
- 6