Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to execute a script file from terminal but it shows error

root@silambarasan-PC:/media/D-DEVELOPME/androidSdk/adt-bundle-linux-x86/sdk/tools# ./android
-bash: ./android: Permission denied`

so I saw the file permissions from terminal & tried to give execute permission. but no use even I give permission it won't change.

root@silambarasan-PC:/media/D-DEVELOPME/androidSdk/adt-bundle-linux-x86/sdk/tools# ll android 
-rw-r--r-- 1 silambarasan silambarasan 3498 Dec  6 08:14 android
root@silambarasan-PC:/media/D-DEVELOPME/androidSdk/adt-bundle-linux-x86/sdk/tools# chmod 777 android 
root@silambarasan-PC:/media/D-DEVELOPME/androidSdk/adt-bundle-linux-x86/sdk/tools# ll android 
-rw-r--r-- 1 silambarasan silambarasan 3498 Dec  6 08:14 android`

I don't know what to do.

Thank you.

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

Easiest would be to copy the executable to your home folder and start it from there.

But…

It seems your executable is mounted on an external partition. Make sure the partition is not mounted with noexec. Try:

grep '/media/D-DEVELOPME' /etc/mtap | grep noexec

If you see a line containing the word "noexec", try re-mounting the partition without the noexec flag:

mount -o remount,exec /media/D-DEVELOPME

Also make sure your media actually allows you to change the permissions, e.g. you cannot do that on a mounted CD or an SD crad with the read-only switch on.

share|improve this answer
    
I tried Easiest way, works now. Thanks lot @Attila O –  Silambarasan Feb 16 '13 at 9:37
add comment

Instead of chmod 777 file, you may use chmod u+x file. Where u means user and x means execution permissons. See man chmod pages for more information. I know that 777 gives all permisson for read, write execute for user, group and others, try using the syntax with u+x.

share|improve this answer
add comment

Your Answer

 
discard

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.