E-learning module "Linux Basics"

Changing Access Permissions

$ chmodchange file mode (bits). Change (add or remove) existing permisions.

Permissions can be changed using a 4-digit (octa) number:
  • Read=4
  • Write=2
  • Execute=1
     → the required permissions are added.

0000 → position for user permissions
0000 → position for group permissions
0000 → position for other permissions.

 

Sample for setting permissions:

$ chmod 740 file.bsp → user: read/write/execute; group: read; others: no permissions.

 

There is an alternative way to change the permissions:
  • user=u
  • group=g
  • others=o
  • all=a (=u, g and o)
  • read=r
  • write=w
  • execute=x

Sample for setting permissions:

$ chmod u+w → Add (+) write (w) permission to user (u).
$ chmod g-w → Remove (-) write (w) permission from group (g).
$ chmod a+r → Add (+) read (r) permission to all.

The content of this e-learning module is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany license (CC BY-NC-SA 3.0 DE).



Bisher wurde noch kein Kommentar abgegeben.