Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run an executable (testdisk) but double click doesn't work. The only way is to run:

sudo ./testdisk

from terminal. But I'd like to open executables with double click in future. How can I do this?

share|improve this question

To run an application by double clicking it's icon we have to define a .desktop file stored in the location from where we want to start it (e.g. on the ~/Desktop/).

The minimal content of such a file may be similar to the following:

[Desktop Entry]
Exec=/path/to/executable  --options # commands to run
Icon=/path/to/icon # optional path to the icon
Terminal=false # set `true' for terminal applications

Save this file on the desired location and give it executable permission.

Side note: it is not really a good idea to run your example application Testdisk by a double click from the GUI.

share|improve this answer

enter image description hereRight click on the file ,and check the Allow executing file as program button in permission tab

Then Double click on the file and choose run or run in terminal(If it is a console application )


This wont work if program need root permission

share|improve this answer
'answered 9 secs ago' great minds think alike? – Tom Brossman May 25 '12 at 14:00

Open the file manager or nautilus.
Go to Edit->Preferences.

  • Under the behavior tab, click/enable the 3rd option --"ask each time" for "executable text files".
  • Or use "run executable files when they are opened"
share|improve this answer

Your Answer


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.