chmod [reference][operator][mode] file...
The references are used to distinguish the users to whom the permissions apply i.e. they are list of letters that specifies whom to give permissions. The references are represented by one or more of the following letters:
u
owner file's ownerg
group users who are members of the file's groupo
users who are neither the file's owner nor members of the file's groupa
all all three of the above, same as ugoThe operator is used to specify how the modes of a file should be adjusted
+
add Adds the specified modes to the specified classes-
remove Removes the specified modes from the specified classes=
set The modes specified are to be made the exact modes for the specified classesr
Permission to read the file.w
Permission to write (or delete) the file.x
Permission to execute the file, or, in the case of a directory, search it.s
Set used id (setuid
or SUID
) bit , If we set the setuid bit on an executable file, the file always runs with the privileges of the file owner, no matter who launches it.