Controlling File and Directory Permissions in Linux | Day 3



This content originally appeared on DEV Community and was authored by Jagannath Ghantenavar

Linux permissions are categorized into three types:
read (r),
write (w),
execute (x).

Each file or directory has three levels of permissions: user, group, and everyone, which define who can do what with the file. ( -rw-rw-r– this indicates -user-group-everyone– what access dose the particular level has for that file or Dir.

  1. To modify these permissions, the chmod command is used. For example, to grant execute permissions to a file or directory, the command chmod +x filename is used.

  2. Similarly, to remove permissions, the chmod command can be used with a – sign. For instance, chmod -w filename would remove write permissions from a file, preventing it from being altered.


This content originally appeared on DEV Community and was authored by Jagannath Ghantenavar