Bash scripting 13 – Linux permission table
As previously mentioned scripts need to be given permission to run. This table should help with the process of working out what permission to set on a file or script.
I think the usual default is 755 which gives the user read, write, execute. Both the group and other users of the system get read and write.
For the most part, you can set execute permission on a script with
chmod +x scriptname.sh
READ | WRITE | EXECUTE | ||||||
---|---|---|---|---|---|---|---|---|
USER | GROUP | OTHER | USER | GROUP | OTHER | USER | GROUP | OTHER |
400 | 40 | 4 | 200 | 20 | 2 | 100 | 10 | 1 |
The markdown code for the above is
| | **READ** | | | **WRITE** | | | **EXECUTE** | |
|:-------:|:--------:|:-------:|:-------:|:---------:|:-------:|:-------:|:-----------:|:-------:|
| _USER_ | _GROUP_ | _OTHER_ | _USER_ | _GROUP_ | _OTHER_ | _USER_ | _GROUP_ | _OTHER_ |
| **400** | **40** | **4** | **200** | **20** | **2** | **100** | **10** | **1** |
Which may be useful. I used Tables Generator to help create this.
Chat
I am on the Devon and Cornwall Linux user group mailing list and also their matrix channel as zleap, it is better to ask there, that way others can answer too.
Tags
#Bash,#Bashscripting,#Files,#Permissions.#chmod,#Read,#Write, #Execute
Mastodon | Peertube | Join Mastodon |
AI statement : Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity. Consent CANNOT be assumed, it has to be granted.