Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am itnerested to learn more about my system. Started for example a gui application "Printing". A shiny nice name in the title.

There is no file "printing" in /usr/bin.

Is there some trick to show the real name of the application in the filesystem instead of "printing", for example "printgui"?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Usually GUI applications are started through "launchers", i.e. .desktop files. You are seeing "Printing" in your menus instead of the real name because that is the "generic name" of the application (details in the link I posted). Depending on what DE you are using you might be able to right click on the menu entry and select Edit or Properties which would allow you to see the executable path and sometimes the real name for that app. That's not possible in a DE like Gnome 3 so here is a solution that should work regardless of your DE.

.desktop files are located in /usr/share/applications so simply grep-ing for GenericName=Printing should list at least one launcher containing that string.

E.g. I don't have "Printing" on my system but I have "Text Editor". I want to know the real name of the application/executable so I run:

grep "GenericName=Text Editor" /usr/share/applications/*

which outputs:

/usr/share/applications/gedit.desktop:GenericName=Text Editor

So the "launcher" for "Text Editor" is /usr/share/applications/gedit.desktop. Now, in order to know the real name and executable for "Text Editor" I have to grep the value of two keys: Name and Exec:

grep -E '(^Name=|^Exec=)' /usr/share/applications/gedit.desktop 

which outputs:

Name=gedit
Exec=gedit %U

For the full path of the executable, it's only a matter or running:

which gedit

and that returns:

/usr/bin/gedit
share|improve this answer

I transposed answer above into the script execCmdGnome3.sh shown below. I use this utility to find out how to call applications out of terminal whose gnome shell name I know.

#!/bin/bash
#
# Name: execCmdGnome3.sh
# Usage e.g.: sudo execCmdGnome3.sh "Document Viewer" 
# Output: Found Launcher: "evince.desktop"
#         Name=Document Viewer
#         Exec=evince %U

launcher=`grep "$1" /usr/share/applications/* | sed s/.*applications.// | sed s/:.*// | uniq`
echo "Found Launcher: \"$launcher\""
grep -E '(^Name=|^Exec=)' "/usr/share/applications/$launcher"
share|improve this answer

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.