Web & Software Developer

Linux Chmod Permissions Cheat Sheet

Set the permissions for a file or directory by using the chmod command. Each row has 2 examples, one for setting that permission for a file, and one for a directory named ‘dir’. This works in any linux distro, such as Ubuntu, etc.

Permission Command Examples Description
rwx rwx rwx chmod 777 filename
chmod -R 777 dir
Anybody can read, write, execute.
rwx rwx r-x chmod 775 filename
chmod -R 775 dir
Owner & Group can read, write, execute. Everyone else can read, execute.
rwx rwx r– chmod 774 filename
chmod -R 774 dir
Owner & Group can read, write, execute. Everyone else can read.
rwx r-x r-x chmod 755 filename
chmod -R 755 dir
Owner can read, write, execute. Everyone else can read, execute.
rwx — — chmod 700 filename
chmod -R 700 dir
Owner can read, write, execute. No one else has any rights.
rw- rw- rw- chmod 666 filename
chmod -R 666 dir
Everyone can read, write.
rw- rw- r– chmod 664 filename
chmod -R 664 dir
Owner & Group can read, write. Everyone else can read.
rw- r– r– chmod 644 filename
chmod -R 644 dir
Owner can read, write. Everyone else can read.

By

We've 7 Responses

  1. November 8th, 2018 at 10:40 am

    This is a good list for the basics. It would be even better if you expanded it to include examples for changing the suid, sgid, and sticky-bit flags.

    avatar

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]