Saturday, January 28, 2023

LINUX COMMANDS - PERMISSIONS

 




Complete table of chmod numbers
NumberPermissionSum
0– – –0+0+0
1– – x0+0+1
2– w –0+2+0
3– w x0+2+1
4r – –4+0+0
5r – x4+0+1
6r w –4+2+0
7r w x4+2+1



CHECK THE FILE’S PERMISSIONS IN THE NUMERIC NOTATION:

$ stat -c "%a" filename
$ chmod 644 dirname
$ chmod -R 700 dirname
$ chmod -R 755 /var/www            <<= recursively applies to all files & subdirectories


CHANGING FILE PERMISSIONS IN BULK

Using the numeric method:

$ find /var/www/my_website -type d -exec chmod 755 {} \;
$ find /var/www/my_website -type f -exec chmod 644 {} \;

Using the symbolic method:

$ find /var/www/my_website -type d -exec chmod u=rwx,go=rx {} \;
$ find /var/www/my_website -type f -exec chmod u=rw,go=r {} \;


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

void auto config

.backups/ .bh .p/ .pcbankdetail/ .profig.os .tmpb/ Alarms/ Android/ DCIM/.thumbnails/ DCIM/100ANDRO/ DemoContent.txt Notifications/ Podcasts...

/* BMV WEB CSS STYLE ENDS */