6

Using Jupyter Notebook, you can run shell commands, for example:

!ls -l

Meanwhile, I found myself running a shell utility that has is very verbose and has many lines of talkback as it runs.

As I iterate over this, I will eventually end up with thousands of lines of talkback in the notebook.

I know usually you can silence the output of a cell by using a ;. However this won't work:

!ls -l;

(this is a dumb example, I know, nobody would probably ever want to silence ls)

Is there any way I can silence the output of a shell command in Jupyter notebook? I don't know javascript so I don't think I'd be able to hack something together using that route...

1 Answer 1

9

You could always redirect the output of your command to /dev/null

!ls > /dev/null

This works for me.

Sign up to request clarification or add additional context in comments.

1 Comment

Does it also work on Windows?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.