User Tools

Site Tools


adding_and_removing_permissions_shorthand

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
adding_and_removing_permissions_shorthand [2016/07/25 19:53] walkeradminadding_and_removing_permissions_shorthand [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Adding and Removing Permissions Shorthand ====== ====== Adding and Removing Permissions Shorthand ======
 +<color darkorange>2016</color>
 \\  \\ 
-\\  
-Shorthand yes, but long brain! 
 \\  \\ 
 \\  \\ 
Line 19: Line 18:
 \\  \\ 
 \\  \\ 
-     +So if you can imagine, that each set of three binary numbers, corresponds with the three rights per Owner, Group and User. Then you can use Octal numbers to set the binary equivalent rights. 
 +\\ 
 +Wait what? I don't get it! 
 +\\  
 +\\ 
 +Remember this: 
 +\\  
 +        -rw-r--r-- 1 pi pi 4452 Jul 25 18:01 example.py 
 + 
 +        Could be written: 
 +         
 +        -110 100 100 (a one where that attribute is on, a zero where it is off) 
 +        - (minus sign) is the file/directory, we don't change that 
 +         
 +        -110 100 100 binary, in Octal would be 644 
 +\\  
 +\\  
 +Let's look at a file with all rights: 
 +\\  
 +        chmod 777 examply.py 
 +        ls -l 
 +        -rwxrwxrwx 1 pi pi 4452 Jul 25 18:01 example.py 
 +\\  
 +\\  
 +We just did a CHMOD 777 on a file, so: 
 +\\  
 +        File has FULL permissions      
 +        -rwxrwxrwx is -111111111 or in octal 777 
 +\\  
 +\\ 
 +Now we will revert the permissions: 
 +\\  
 +        chmod 644 example.py 
 +\\  
 +\\  
 +Now we have used CHMOD 644, so: 
 +\\  
 +        ls -l         
 +        -rw-r--r-- 1 pi pi 4452 Jul 25 18:01 example.py 
 +         
 +        Now our file is back to its original permissions. 
 +\\  
 +\\ 
            
adding_and_removing_permissions_shorthand.1469472819.txt.gz · Last modified: 2023/03/09 22:35 (external edit)