1

As you can see from the image below (htop), I have several vlc processes running, all with only the command vlc. However, I'm only running one vlc instance.

enter image description here

What are the other instances? Would it be safe to terminate them? And how can I tell which process is attached to my current instance?

11

Those aren't separate processes, they're threads. VLC has a lot of things going on under the covers, each handled by a separate thread.

Press H in htop to hide threads, showing processes only.

1

My guess is that VLC is spawning child processes (much as the Apache HTTP server does, for example). If that's the case, and if your version of ps supports it, you can try running ps -H to see processes listed in a tree arrangement. Use -C vlc to limit output to only vlc processes.

$ ps -H -C apache2
  PID TTY          TIME CMD
 1374 ?        00:00:00 apache2
 1377 ?        00:00:00   apache2
 1378 ?        00:00:00   apache2
 1379 ?        00:00:00   apache2

Alternatively, use ps -f to get "full" output, including parent PID (PPID). Again, this makes it clear which process is the parent process.

$ ps -f -C apache2
UID        PID  PPID  C STIME TTY          TIME CMD
root      1374     1  0 03:47 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1377  1374  0 03:47 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1378  1374  0 03:47 ?        00:00:00 /usr/sbin/apache2 -k start
www-data  1379  1374  0 03:47 ?        00:00:00 /usr/sbin/apache2 -k start

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.