2

I run "Videos" software from the Dash in Ubuntu. After some minutes the software freezes.

I've tried searching for the PID of the software to kill it, but I can't find any result with these commands:

pgrep Videos

ps -eo cmd,pid,stime

I don't know the stime of the process.

I have to restart my computer and after login, I see the software is executed by totem command.

How can I find the PID for software where the name of the software is different from that of the executable file?

heemayl
  • 91,753

2 Answers2

4

If you run a command from terminal then the command will always show up in the process table being a process.

Your case is different as you have run a Desktop entry (declared in a .desktop file), whose name and the command it executes can be totally different.

The .desktop files use an INI format to express metadata.

Here is the Desktop entry for htop:

[Desktop Entry]
Version=1.0
Name=Htop
Type=Application
Comment=Show System Processes
Terminal=true
Exec=htop
Icon=htop
Categories=ConsoleOnly;System;
GenericName=Process Viewer

In you case, the Name is Videos and the Exec line will indicate the actual command executed.


You should track down the .desktop file and check the entry to get the command actually being executed.

So lets find the .desktop file that contains Name=Videos:

% grep -RH '^Name=Videos$' ~/.local/share/applications /usr/share/applications
/usr/share/applications/totem.desktop:Name=Videos

Got it !!

It's declared in /usr/share/applications/totem.desktop.

Now let's check what command it actually runs:

% cat /usr/share/applications/totem.desktop
[Desktop Entry]
Name=Videos
Comment=Play movies
Keywords=Video;Movie;Film;Clip;Series;Player;DVD;TV;Disc;
Exec=totem %U
Icon=totem
Terminal=false
Type=Application
.
.
<truncated>

As you can see, the Exec key says totem %U. %U indicates a list of URIs.


Now, if you do:

pgrep totem

you would get the PID of the totem instance.

heemayl
  • 91,753
0

The default video player of Ubuntu is totem, so if you want to find the PID of the Video player, you should find the totem process. You can do like this:

ps aux | grep totem, then you can kill the PID of totem.
And you can get the information in SoundVideoDefault

zhenguoli
  • 286