Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
possible duplicate of Why does htop show more process than ps –  Gilles Dec 8 '11 at 19:42
add comment

2 Answers 2

up vote 10 down vote accepted

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.

share|improve this answer
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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