Here we can see the highlighted portion. This posrtion tells the user permissions for each file. Lets break the highlighted portion down:
drwxr-xr-x
Here:
ddenotes that the current folder is a directoryrstands for read accesswstands for write accessxstands for execute access
Now lets see what our user (kali) and other user on this machine have permissions for the highligted folder called Documents
Reading from left to right we know that d stands for directory.
After that the permissions are listed.
-
The first permissions are of the owner of the file (which is in this case
kali):rwxdenotes that thekaliuser has all three read, write and execute permission on this directory -
After that we have the permission for the group users:
r-xmeaning that the group user only has the read and execute permissions not the write permission -
Lastly we have the third settings for all users:
r-xmeaning that both read and execute only and no write access
Here we have created a file named hello.txt through the echo command. On viewing the permissions we come to know that our current user and owner of this file has only read and write but no execute permissions for this file.
In order to change this permissions we use the chmod command. There are two ways of doing it:
-
Here we used the following command syntax:
chmod +<permissions> <filename> -
Here we have used the following command:
chmod <numeric_permissions> <filename>Each permission (read, write, execute) is represented by a digit:
-
Read = 4
-
Write = 2
-
Execute = 1
For example:
chmod 755 hello.txtThis gives:
-
Owner: read + write + execute (7)
-
Group: read + execute (5)
-
Others: read + execute (5)
-
Below are the tables for easier understanding of these representations:
| Symbol | Permission | Binary | Value | Description |
|---|---|---|---|---|
r |
Read | 100 | 4 | View file contents / list directory |
w |
Write | 010 | 2 | Modify file / create-delete in dir |
x |
Execute | 001 | 1 | Run file as program / enter directory |
- |
No perm | 000 | 0 | No permission |
| Command | Owner | Group | Others | Meaning |
|---|---|---|---|---|
chmod 777 file |
rwx | rwx | rwx | Full access for everyone |
chmod 755 file |
rwx | r-x | r-x | Owner full, others can read & execute |
chmod 700 file |
rwx | --- | --- | Only owner has full access |
chmod 644 file |
rw- | r-- | r-- | Owner can read/write, others can only read |
chmod 600 file |
rw- | --- | --- | Only owner can read and write |
sudo adduser <name>
su <username>
Here we have created a user named John and switched from user kali to john using the su command
grep "<word>" <filename/path>


.png)
.png)
.png)

