4

I'd like to disable the output I get from VLC when calling it from bash. You can see that output on the following picture:

So, how do I disable that?

Redirecting output to /dev/null like described here doesn't work.

Note that, on the picture, I had to send kill sign twice to kill it, why if there is just one process? Or are there two? Maybe there are actually two processes and with my command only the output of the first one is redirected.?

If I run it in the background, and I send kill singal, first, it looks like process is no longer running in shell but just in a window, but than, soon I get some messages again. Check out the picture:

So anyway, I just want to disable that output.

UPDATE: And I want to run it in background too.

vlc &> /dev/null 

The following should work, but right now I've tried and it didn't work well.

vlc "filename" &> /dev/null & 

And here's what I've got:

I play the file, at first it looks okay, then I start changing directories and issuing other commands, and VLC output comes in again

But that was the first time I've tried, now it works, so I guess it'll work in future too.

Scarass
  • 223
  • 2
  • 4
  • 10
  • updated the question – Scarass Jan 10 '17 at 21:29
  • Please! start vlc with: `Alt-F2 then write vlc` and press enter. That is how a gui app should run (most of the time) unless you do need or want the error lines. –  Jan 10 '17 at 21:41
  • but when running it from the command line it's easier too choose a file to play – Scarass Jan 10 '17 at 22:25

1 Answers1

5

If you use vlc > /dev/null then standard output will be redirected to /dev/null but standard error will go through to the terminal. You must use the command vlc &> /dev/null which will redirect both standard output and standard error. I've tested this and it works. According to the manual, vlc -q will enable "quiet" mode (suppress output) - I haven't tested this.

EDIT I'm not completely sure what you mean by "in the background", but the program screen (sudo apt install screen) will allow you to start a command in a terminal, then close the terminal but keep the command running. nohup can also do this. Or, try pressing Alt-F2 at the desktop, you will probably get a prompt to run a command. You can run vlc from there, but unlike screen, you cannot interact with vlc in a terminal later.

ANOTHER EDIT This question looks like just what you need. How to disable VLC output in command-line mode?

  • I have just quickly tried vlc -q, it didn't work for me. vlc &> /dev/null does redirect stderr too, but I doesn't run process in background. vlc &> /dev/null & does niether. – Scarass Jan 10 '17 at 21:25
  • Really? For me, `vlc &> /dev/null &` suppresses all output from vlc, leaving only the `[1] 14769` message. –  Jan 10 '17 at 21:32
  • @Scarass I've edited my answer. –  Jan 10 '17 at 21:38
  • Tell me about your software - what Linux dist, which bash version, which VLC version, which bash flags, you get the idea. Add that to your question. –  Jan 10 '17 at 22:32
  • Edited question. I'm running Mint Cinnamon, VLC 2.2.2, Bash 4.3.46, don't know what are bash flags. – Scarass Jan 10 '17 at 22:37
  • What I really want is to reduce the output to 1 line per file (I'm playing an m3u list). I'm guessing that the debug log level is irrelevant to stdout/stderr output. – Sridhar Sarnobat Apr 30 '22 at 19:45
  • `-q` does reduce the output but not everything. – Sridhar Sarnobat Apr 30 '22 at 19:47