Recently I switched over to Linux Mint. I am finally getting the hang of using the terminal, but there is one question that I find myself coming back to:

Is it possible to start a program that is stored in the system's menu?

I know that programs like e.g. firefox and libreoffice place an executable file in the /bin/ or /usr/bin/ folders (and that you can use which programname to find out where it is stored) and they seem to be able to be executed from any location the terminal might be at. But is there a way to run programs that are stored in the menu, but not in one of above-mentioned folders?


In XFCE you can drag the icon of your desired application with your mouse to your terminal, you should see the name of the shortcut. This is what I got for Abiword:


Then you can view this file with less /usr/share/applications/abiword.desktop, or just find the executable:

grep Exec /usr/share/applications/abiword.desktop

which reports:

Exec=abiword %U

So whenever you click on abiword, or drag a document file on it, it executes abiword, and then the name of the file. This is also true for "programs that are stored in the menu, but not in one of above-mentioned folders" (PATH).

You can also add appropriate folders to your path. Just add this in ~/.bashrc (if you use bash which is most likely):

export PATH=$PATH:/path/to/binfolder

Obviously you should replace /path/to/binfolder with the folder which your desired application resides.

|improve this answer|||||

Short answer yes.

But if the executable isn't in one of the directories in your $PATH, then you would have to call the executable with the full /path/to/executable.

|improve this answer|||||

Menu entries or desktop shortcuts are .desktop files. The standard location for the desktop files of applications installed system-wide is $XDG_DATA_DIRS/applications (by default it is set to /usr/local/share/applications and /usr/share/applications) and for the things installed in your home or menu items you created it is $XDG_DATA_HOME/applications ($HOME/.local/share/applications by default).

Once you have its path, to "run" the desktop file you can use :

xdg-open path/to/application.desktop
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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