File and Directory Permissions
Checking Permissions with ls
The ls command is used to list files and directories. When combined with the -l option, it provides detailed information about files and directories, including their permissions.
ls -l-l: This option provides a long listing format, showing additional information about files and directories.
The output will look something like this:
-rw-r--r-- 1 user group 4096 Oct 30 10:00 example.txtrw-r--r--: This represents the file permissions. The first three characters (rw-) indicate read and write permissions for the user, the next three (r--) indicate read-only permissions for the group, and the last three (r--) indicate read-only permissions for others.1: This indicates the number of hard links to the file.user: This is the owner of the file.group: This is the group associated with the file.4096: This is the file size in bytes.Oct 30 10:00: This is the last modification time of the file.example.txt: This is the name of the file.
