If you’re a new user or student and want to learn how to use and manage Linux systems, the easiest place to start might be on Ubuntu Linux OS. Ubuntu is an open-source Linux operating system that runs on desktops, laptops, servers and other devices. When you’re ready to learn how to use the chmod commands, follow the guide below: About the chmod command: The chmod command is used to define or change permissions or modes on files and limit access to only those who are allowed access. It changes the mode of each FILE to MODE. The chmod command stands for change mode. and it’s used to limit access to resources. It’s the same as using your mouse to right-click a file or folder and selecting the permission tabs and defining who can access the resource. the chmod command is the way to do it on the command line. Syntax: The syntax is the rule and format of how the chmod command can be used. the syntax options can be reordered. but a straight format must be followed.,. Below is an example syntax of how to use the chmod command. or Options: The command line options are switches or flags that determined how the commands are executed or controlled. they modify the behavior of the commands. they are separated by spaces and followed after the commands. Below are some options for the chmod command: Examples: Below are some examples of how to run and use the chmod on Ubuntu Linux. If you’re an owner of a file called Confidential and want to change the permissions or modes so that users can read / write and execute, group members can read and execute only and others can only read, you will run the commands below. The commands above change the permission of the file called Confidential so that the user can read (r), write (w), and execute (x) it. group members can only read (r) and execute (x) and others can only read (x) its content. The same command above can be written as shown below using its octal permission notation. If you’re not logged in as a root account, you may have to use the sudo command it it. The digit 7 is equal, read, write and execute. the digit 5 is equal, to read and execute, and the digit 4 is equal to read.
4 = Read 2 = Write 1 = Execute 0 = no permission
So, 7 = 4 + 2 + 1 (rwx); 5 = 4 + 1 (RX); 4 (r) To configure access to a file so only the user can read, write and execute and group/others can read, run the commands below. The commands below change the permissions of the Confidential file so that everyone has full access. read/write/execute When you run chmod with the –help option, you’ll see the help text below: That’s it! Hope you like it and please come back soon for more Ubuntu Linux commands!