Tuesday, April 8, 2014

chmod command

chmod u+x file.txt

  1. Grant read and write permission to owner and read permission to group and other using an absolute mode.
    chmod 644 myfile
    
  2. Deny write permission to group and other.
    chmod go-w myfile
    
  3. Clear all permissions that are currently set and grant read and write permissions to owner, group, and other.
    chmod =rw myfile
    
  4. Grant search permission on a directory to owner, group, and other if search permission is set for one them.
    chmod +X mydir
    
  5. Grant read, write, and execute permission to owner and read and execute permission to group and other using an absolute mode.
    chmod 755 myfile
    
  6. Clear all permissions for group and other.
    chmod go= myfile
    
  7. Set the group permissions equal to the owner permission, but deny write permission to the group.
    chmod g=u-w myfile
    
  8. Set the set-user-id on execute bit and grant read, write, and execute permission to the owner and execute permission for other using an absolute mode.
    chmod 4701 myfile
    

No comments: