How to find out the terminal command of an application?

Solution 1:

Most default applications will have a .desktop file located in /usr/share/applications.

To find out about the corresponding terminal command that will be run when launching one of these applications open the file browser Nautilus and right click on the application's icon to select Properties in the context menu. This will give you all details you need (shown here for System Settings that will run gnome-control-center -overview)

application launcher properties view

Solution 2:

If you installed the application through the repositories or through dpkg, you can use this command:

dpkg -l | grep "application name"

This will search through all your installed applications, as well as search their descriptions; searching the description is the important part here, because the description usually contains the name of the application, even if the "command" to run it does not contain the application name.

Example:

In GNOME, there's an application called the Disk Usage Analyzer. However, the command to run it from the terminal is not disk-usage-analyzer. To find out its command, you can run:

dpkg -l | grep "disk usage"

The output should contain this entry:

alaa@aa-lu:~$ dpkg -l | grep "disk usage"
ii  baobab            3.6.4-0ubuntu1          i386         GNOME disk usage analyzer

Look at the second column. The command to actually run the Disk Usage Analyzer is baobab.

Solution 3:

What you can do is use xprop: it will let you click on a application and display information. To get the name, enter in a terminal:

xprop | grep WM_CLASS

if WM_CLASS doesn't work, then try with WM_COMMAND.