User Tools

Site Tools


permissions_for_directories

Differences

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

Link to this comparison view

Next revision
Previous revision
permissions_for_directories [2016/07/25 20:08] – created walkeradminpermissions_for_directories [2023/03/09 22:35] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Permissions for Directories ====== ====== Permissions for Directories ======
 +<color darkorange>2016</color>
 +
 +----
 +
 \\  \\ 
 +The same series of permissions may be used for directories but they have a slightly different behaviour.
 \\  \\ 
 +        r - you have the ability to read the contents of the directory (ie do an ls)
 +        w - you have the ability to write into the directory (ie create files and directories)
 +        x - you have the ability to enter that directory (ie cd)
 +\\ 
 +Example:
 +\\ 
 +        ls testdir (list testdir contents)
 +        file1  file2  file3
 +        
 +        chmod 400 testdir (400 is 100000000) so r--- --- ---
 +        
 +        cd testdir (change directory to testdir)
 +        -bash: cd: testdir: Permission denied
  
 +        chmod 100 stops access to a directory
 +\\ 
 +\\ 
 +Example2:
 +\\ 
 +        chmod 100 testdir - (100 = 001000000 or --x --- --- so execute rights only)
 +        
 +        ls testdir
 +        ls: cannot open directory testdir: Permission denied
 +        
 +        cd testdir - I can't list the director, but I can change to it
 +        cat file1 - and I can view a file I know exists!
 +        
 +        this is a test file
 +        you have opened it
 +\\ 
 +\\ 
 +I am sure I'll find a use for that? :)
 +\\ 
 +\\ 
permissions_for_directories.1469473739.txt.gz · Last modified: 2023/03/09 22:35 (external edit)