-1

Help! I just need to know the complete command. To add the execute permission. Please.

user369810
  • 11
  • 1

1 Answers1

-1

To give the execute permission to a shell script or the like, key in:

chmod +x /dir_path/file_name.sh

Make note, you'll need sudo for a file that is found in any of the system required folders.

For a further read into Linux permissions, click here. You'll find that there are two official ways of granting execute, as well as, more detail on how to formulate them.

Fabby
  • 34,259
Miphix
  • 1,028
  • 2
  • 9
  • 21
  • 3
    sudo is not required in all cases. Try not to use unnecessary sudo – sourav c. Jan 18 '15 at 05:40
  • 3
    I think changing other permissions is not a good idea,i.e.,you are setting read+write permissions for group and others which is not desired here.The questioner asked only to add the 'executable' permission,For this the answer is simple "chmod +x " and also "sudo" is unnecessary. – saptarshi nag Jan 18 '15 at 05:52
  • I cant do it. Please help me. Can you teach me how. @Miphix Please . I need your help – user369810 Jan 18 '15 at 05:52
  • 1
    Use "chmod +x filename" to add executable permission. @user369810 – saptarshi nag Jan 18 '15 at 05:54
  • @user369810 for a file that is found in the /home/user369810/bin directry that is named FirewallAtHome.sh type in terminal $ chmod +x ~/bin/FirewallAtHome.sh Once you have assigned the execute permission, you'll find that it will execute. Also, you'll have to make sure that the file is found within path if you just want to type into terminal FirewallAtHome.sh in the terminal and have it execute. It's common practive to have a ./bin folder in the root directory of your home folder (Not '/'). For example, /home/user369810/bin. after you've made that file type in "$ echo $PATH" – Miphix Jan 18 '15 at 06:28
  • 1
    @Miphix: What you did was too dangerous to let it be as other users who do not read the question well might get side-effects... My apologies for the edit. – Fabby Jan 19 '15 at 16:37
  • @Fabby it's ok. I would appreciate a note as to which dangerous command or action so as to correct my own understanding – Miphix Jan 20 '15 at 00:11
  • 755 treats files and directories the same. Your command makes directories list-able and readable by all users (AND it also makes all files executable...) ;-) – Fabby Jan 20 '15 at 00:19
  • I didn't realize it was inherited. Is there documentation that would expand on this – Miphix Jan 20 '15 at 00:23