technical solution-Linux Command Line (21) File and Directory Permissions Linux command tricks from Techmirrors

technical solution-Linux Command Line (21) File and Directory Permissions Linux command tricks from Techmirrors



I start off calling the file owner the user/owner and we look at the group and discuss that each user/owner and group have a number associated with them. The number is what Linux uses, the name is just there to help us humans keep track of the user/owner and group IDs.

We then look at the first column displayed with the ls -lh command and see that the first character is describes what type of file it is “d” for directory or “-” for file

The nex three characters are for the user/owner permissions. followed by the group permissions, then followed by the permissions for anyone that is not user/owner of the file, and is not a member of the group of this file (but still have access to this file).

The “r” is for read privileges, the “w” is for write, and the “x” is for execute privileges. A dash in place of one of those letters shows there are no privilege for that letter.

A user/owner of a file can change the permissions of that file with the chmod (change mode) command.

The chmod command assigns privileges as ugo (“u” for User/owner, “g” for Group, and “o” for Other)

We can also see how to use the chmod command to assign privileges with octal permissions (numbers 0-7)

sourceTechmirrors