Skip to content

Instantly share code, notes, and snippets.

@archiewald
Last active April 16, 2019 05:36
Show Gist options
  • Save archiewald/d887d0d23f29e776ef6ae86cfdca8d79 to your computer and use it in GitHub Desktop.
Save archiewald/d887d0d23f29e776ef6ae86cfdca8d79 to your computer and use it in GitHub Desktop.
[Unix file permissions] #terminal
  • r read
  • w write
  • x execute

Broken into 4 sections

ls -l

- rwx r-- r--
- inicates a files, d - a directory, l - a link permissions for the owner permissions for members of the group owning th file permissions for other users

chmod

If you want to add or remove permissions to the user, use the command chmod with a + or , along with the r (read), w (write), x (execute) attribute followed by the name of the directory or file.

  • chmod +wx filename
  • chmod -rwx filename
  • for group add g, for user add o chmod g+w testfile chmod o-rwx workfolder

chown

cut -d: -f1 /etc/passwd - list all the users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment