I have a script.sh file and type of this file is shellscript file. I want to make this file as application/x-executable file. How can I make it?
well you can make it by doing as
so it will execute when you call it will
and you can access that script as application also .
open your terminal and type as below from your home directory .
then in the opened file , type this at last line.
save and close .
Then type this in your terminal
make sure that you have placed in the home directory .
Hope that helps.
There are two ways of making a file executable:
Go to the permissions tab, then tick the box `Execute: [ ] Allow executing file as program.
Terminal / Command method:
You can either use:
Or just run:
The spaces are to show that it is split up:
The first set of
r stands for Read, w for Write and x for eXecute.
So to allow everyone to read it, but only Group to execute and User to read and write it (but for some reason not execute) would be:
So there are these numbers:
Execute by user is
Write by user is
Read by user is
Then you add these together to get the desired combination.
So to allow everyone to read it, but only Group to execute and User to write it (but for some reason not execute) would be:
That adds up to 600 + 050 + 004 = 654.
You could then run the command.
And to set all permissions you can type:
Or (this is a bit easier to write, but harder to remember each one):
Finally, you can do:
To take all permissions away from everyone.
To add read and write for user, without affecting any other permissions (e.g. Execute permissions).
This website has a very useful little grid checkbox thing, whereby you can tick the options you want and it gives you the command:
However, not all the possible combinations are sensible to use; the main ones that are used are the following:
And, if you're using non-trivial user groups:
777 and 666 are rarely used, except in /tmp.
To make it un-executable, run:
For example i created
After i write some code on vi editor, i'll exit from vi editor: