Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-01-2007, 05:13 PM
|
#1
|
|
Member
Registered: Apr 2005
Location: Chicago, IL
Distribution: Ubuntu 9.04
Posts: 355
Rep:
|
bash: ./program: permission denied
I'm trying to open a program.
I've tried:
./program
sudo ./program
sh ./program
sudo sh ./program
sudo chmod 777 program
sudo chmod a+rwx program
sudo chmod a+rwX program
But none of these work.
At one time I was able to just click the program to open it, but I messed that up by changing the file association to sh. Now the 'execute' option is gone.
Any help on a way to fix this would be greatly appreciated. I'm using Xubuntu (Ubuntu) 7.04, and the program is called mupen64.
|
|
|
|
10-01-2007, 06:07 PM
|
#2
|
|
Member
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202
Rep:
|
Are you trying to open a file? Or to run a program? I assume that you meant to run a program.
1. Make sure that the program is in your current directory by entering 'ls -l' at the command prompt.
2. If the command is there then make sure that is has 'execute' attribute, if not then
chmod +x program
3. It should be any messages about permission denied, and you don't need to do any 'sudo ...' (BTW: if you insist on doing 'sudo' make sure that permissions in 'sudoers' file are set correclty)
4. If the 'program' is bash script then the first line should read:
#!/bin/bash
5. If the program is a script you could run it as by entering:
>source program
|
|
|
|
10-01-2007, 07:23 PM
|
#3
|
|
Member
Registered: Feb 2006
Distribution: FC
Posts: 86
Rep:
|
rsashok brings up a good point of knowing what type of file it is you're trying to execute. You can do this with the "file" command. Some examples from my system:
Code:
$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
$ file ~/data/programming/perl/nuke/
/home/user/data/programming/perl/nuke/: directory
$ file ~/data/programming/perl/nuke/nuke.pl
/home/user/data/programming/perl/nuke/nuke.pl: perl script text executable
Sharing your return value will help understand what you're trying to execute.
|
|
|
|
10-01-2007, 08:18 PM
|
#4
|
|
Member
Registered: Apr 2005
Location: Chicago, IL
Distribution: Ubuntu 9.04
Posts: 355
Original Poster
Rep:
|
Thank you for the replies!
chmod +x file worked, but it only did when I moved the program from my xfs sda4 partition to my ext3 home folder.
Here is the output for the file command:
Code:
file mupen64
mupen64: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), stripped
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:51 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|