9

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.

Flimm
  • 41,766
Silambarasan
  • 7,925

2 Answers2

10

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/mtab | 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.

Attila O.
  • 3,512
-1

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.