File Permissions Intro
If you are just getting into linux and upto now have only been using MS Windows operating systems you might find file permissions a bit of a nightmare. Hopefully this page will explain them for you.
Permissions apply to all users on a system apart from the "root" user (the superuser), this is one of the main reasons why you should not log in as "root" apart from when doing system maintenance.
UNIX file permissions are split into the three main following sections:
- User (owner of the file).
- Group (everyone with the same group name as the owner).
- Others (anyone else on the system).
Within these three sections you can specify the following options shown in the table below
(in "ls -l" display order).
|
Here is a typical directory listing using the "ls -l" command, with a files permissions indicated on the left.
If we take one of the files permissions and split it up into its different sections as shown in the diagram below:
As you can see, each section has the space for the three options show in the table above. Where there are "-" characters show that the specific permission is not set.
So, the above set of permissions read:
- Read and write permissions for the user who owns the file ("mark" in this case).
- Read permissions for other users in the same group as the owner ("users" in this case).
- Read permissions for everyone else on the system.
File permissions also apply to directories in the same way, but the options have a slightly different meaning.
- Read access allows users to view a directorys contents.
- Write access allows users to create files in the directory.
- Execute allows users to change into the directory.
download file now