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 wanted to run a small test program, but if I execute it the terminal says:

./ 5: ./ ./main: Permission denied

(program exited with code: 126)
Press return to continue
share|improve this question
Did you make your scripts executable with chmod +x? – Seth Nov 2 '13 at 21:25
What's the output of ls -l? – Braiam Nov 2 '13 at 21:45
chmod +x and wich directory? – Pixdigit Nov 3 '13 at 12:03
drwxr-xr-x 2 max max 4096 Nov 1 14:30 Arbeitsfläche drwxr-xr-x 2 max max 4096 Nov 1 14:30 Bilder drwxr-xr-x 2 max max 4096 Nov 1 14:30 Dokumente drwxr-xr-x 2 max max 4096 Nov 2 21:45 Downloads -rw-r--r-- 1 max max 8445 Okt 30 22:17 examples.desktop drwxr-xr-x 2 max max 4096 Nov 1 14:30 Musik drwxr-xr-x 2 max max 4096 Nov 1 14:30 Öffentlich drwxr-xr-x 2 max max 4096 Nov 1 14:30 Videos drwxr-xr-x 2 max max 4096 Nov 1 14:30 Vorlagen – Pixdigit Nov 3 '13 at 12:04
I had the same problem as yours. Note that if you save your program with .c extension and after that, compile, construct and execute, it works fine (for me). – user247864 Feb 13 '14 at 15:48
up vote 1 down vote accepted

The program was stored in a fat system and files's executable bit can't be changed there.

share|improve this answer

You call in your script another file/script - ./main. Be sure that you have permission to execute that file (in fact this is saying that exit code: 126). To do this, run the following command:

chmod +x /path/to/main
share|improve this answer
because i dont call another script its the script itself. – Pixdigit Nov 3 '13 at 12:33
here the content – Pixdigit Nov 3 '13 at 12:34
@MaxLange The content of what? There is a C program in the given link which can't be executed just like this from terminal. – Radu Rădeanu Nov 3 '13 at 21:10

All I need to to solve Geany permission denied error is to specify the extension of the file that I need to execute in my case I want to execute python programming file e.g. *.py then I save it .py and execute the file by press F5 the permission denied gone.

share|improve this answer

protected by Community Jan 10 at 21:22

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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