Chmod command in UNIX :
- This command is used to change the file permissions. Basically, this command defines who can do what operations on the files. By default, when we create the files, it will be created with Read & Write access to User and Read access to both group and others.
- With this access, the User (Owner) can Read and modify (update) the files and group & Others can only view the files but cannot be modified.
For Ex:
The file “file.txt” has the permission “rw-r–r—”. First 3 fields represents the User (Owner) permission, next 3 fields represents the group permissions and next 3 fields represents Others permission.
So,
- User has “rw” which means Read and Write access.
- Group has “r” which means Read access only
- Others has “r” which means Read only access
- By using “chmod” command we can change the file permissions according to our requirments.
- If I want to execute any of the files, I would need execute “x” permission. Please see the below example on how to provide the execute permission.
Chmod 744 file.txt
Now the above file the execute permission for the User. Likewise, we can change the file permissions according to our needs like, chmod 777 filename or chmod 755 filename etc.
Other UNIX Commands:
Below are the list of basic UNIX commands used in UNIX operation system.
1. ls Command in Unix
2. Man Command in Unix
3. More Command in Unix
4. Vi or View Command in Unix
5. Touch Command in Unix
6. Mv Command in Unix
7. Cp Command in Unix
8. Rm Command in Unix
9. Cat Command in Unix
10. Diff Command in Unix
11. Wc Command in Unix
12. Chmod Command in Unix
13. Gzip Command in Unix
14. Gzcat Command in Unix
15. Gunzip Command in Unix
16. Directories Command in Unix