Page 6 - Newsletter_April_2_2025
P. 6

Understanding file permissions and ownership in Linux

            Now that you are aware of the basic terminology of file permissions and ownership, it’s time to see it in ac-
            tion.

            You can use the ‘stat command‘ or the ‘ls command’ to check the file permissions.

            If you use the ls command with option -l on a file, you’ll see an output like this:
                                     -rwxrw-r-- 1 abhi itsfoss 457 Aug 10 11:55 agatha.txt





















               File type: Denotes the type of file. d means directory, – means regular file, l means a symbolic link.
               Permissions: This field shows the permission set on a file. I’ll explain it in detail in the next section.

               Hard link count: Shows if the file has hard links. Default count is one.
               User: The user who owns the files.

               Group: The group that has access to this file. Only one group can be the owner of a file at a time.
               File size: Size of the file in bytes.

               Modification time: The date and time the file was last modified.
               Filename: the name of the file or directory.

            In the above command, you see the file permission like this in the nine-digit format:
            rwxrw-r--

            Each letter denotes a particular permission:
               ·   r: Read permission
   1   2   3   4   5   6   7   8   9   10   11