ls -al /path/to/file/or/dir
-
for files, or a d
for directoriesrwx
rwx
rwx
for groups and users that are now owning the filerwx
is showed as a -
, it means that the permission is not granted.chmod
-R
to your chmodchmod -R
chmod 777
== chmod -a+rwx
chmod 000
== chmod -a-rwx
chmod -R 750 /home/userdir
rwx
for these, but of course, you should pick the permissions you wish to add or remove.chmod +rwx filename
Will add read, write, and execute permissions to this file anyone on the machine. r stands for "read", w for "write", and x for "execute"chmod +x filename
Will make the file executable by anyone on the machine.chmod -rwx filename
Will remove read, write, and execute permissions to this file anyone on the machine.
Note : root user is the only exception.chmod -u+rwx
chmod -g+rwx
chmod -o+rwx
chmod -a+rwx
chmod -u+r,g-w,o-rwx
+rwx
by anything previously mentionedchmod -R a-s /path/to/dir
chmod -R 0xxx /path/to/dir
chmod -R 0640 /home/user/website
chmod -R u+s /path/to/dir/
chmod -R 2xxx /path/to/dir
chmod -R g+s /path/to/dir/
chmod -R 4xxx /path/to/dir
chmod -R a+s /path/to/dir/
chmod -R 6xxx /path/to/dir