Maintaing your files, and sometimes the filesystem is an important part of being a webmaster. However, it can often be daunting to new webmasters for a number of reasons - most often, this is down to the file permissions on a unix server - usually websites are hosted on unix rather than windows as it is more reliable and poweful. If you have ever connected to your webhost or server through a shell, telnet or FTP you may have
seen your files laid out as below: -rwxrw-r-- 1 bob admin 1024 Dec 14 13:19 index.php
If you are not familiar with this structure it can be very daunting to understand. The information shows who can do what with the files, amonst other things, and could be the reason why your site isnt working. However each section is explained in more detail below.
The file permissions
The file permissions show who is allowed to read, run or edit the files, and is one of the most important parts. The permissions can be split into 3 parts that make up the entire permission list;
-rwxrw-r--
The first character on this line will show what type of file it is - it will either be a "d" for a directory/folder or
a "-" as above for a file.
The next 9 characters are 3 sets of 3 characters to determine the following;
User - Permissions to govern what users can do with this file
Group - Permissions govern what users on this system, in the same group as this file can do with it
Owner - permissions govern what any other user on the same system can do with the file.
These can be an of the following:
r - Read - grants the ability to view the file
w - Write - permits the ability to write to the file
x - eXecute - permits the abiltiy to execute the file - usually for scripts/programs
- - no permissions
The owner/group
The next part specifies who owns the files, and which group the file belongs too. As mopre than one user can belong to each group, it means multiple people can edit and maintain files.
Filetime
The next section is simple - it is the time the file was created.
The filename
The last part shows the name of the file (or directory). In some cases, this will be either "." or ".."
These are both important; "." means that it is the current directory, and ".." is the directory one level up.
--------------------------------------------------------------------------------
From the original example then, we know the following:
-rwxrw-r-- 1 bob admin 1024 Dec 14 13:19 index.php
The file index.php, was created on Dec 14 13:19. It is owned by the user "bob" who is part of the group "admin".
The owner (bob) can Read, Write and eXecute the file.
The other members of the group (admin) can Read and Write to the file.
All other users can Read the file.