Wednesday, April 10, 2019

command line - How can the executable name of a program listed in a Dash search be determined?


Searching on the dash, I can see the program listed as "Personal File Sharing". How can I find the executable name of this program such that it can be launched in a terminal?



Open terminal and use grep to search for "personal file sharing" in /usr/share/applications folder.


In fact, you will have this output:


$ grep -R -i "personal file sharing" /usr/share/applications
/usr/share/applications/gnome-user-share-properties.desktop:Name=Personal File Sharing

Now, if we do this:


$ grep "Exec" /usr/share/applications/gnome-user-share-properties.desktop
Exec=gnome-file-share-properties

That the actual program that runs is `gnome-file-share-properties, which is located at


$ which gnome-file-share-properties
/usr/bin/gnome-file-share-properties

To be more specific, what happens is that in linux there are .desktop files. They are somewhat similar to Windows' shortcuts. These files contain
fields Name= and Exec=. Name part is how the program shows up in the dash search and unity panel. Exec is the actual binary that gets executed


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...