Contact
Site: US UK AU |

What is chmod?

What is chmod?

Overview
Chmod refers to change mode, a command for changing file access permissions in a UNIX-based operating system.

Purpose

The chmod, or change mode, command allows an administrator to set or modify a file’s permissions. Every UNIX file has an owner user and an owner group attached to it, and every file has permissions associated with it. The permissions are as follows: read, write, or execute.

Application

UNIX systems have many users. In this context, a user may refer to an individual or a system operation. UNIX identifies each user with a UID, and users may be organized into groups.

The syntax of the chmod command is:

chmod mode file

Example:

chmod 720 readme.txt

Each number in the mode parameter represents the permissions for a user or group of users:

  • The first number represents the file’s owner

  • The second number represents the file’s group

  • The third number represents everyone else

Table 1 shows the eight numbers that can be used within the chmod parameter. The rwx column specifies read, write, and excecute access, offering a binary value for each operation. A "1" means "yes," a "0" means "no." If rwx reads 110, then that permission may read and write, but not excecute.

# Permission rwx
0

 none

000
1  execute only  001
2 write only  010
3  write and execute 011
4  read only  100
5  read and execute  101
6  read and write  110
7  read, write, and excecute  111

Table 1. chmod mode parameters.

For example, if you set your directory permissions to 720, then your permissions would function as follows:

  • The file’s owner may read, write, and execute the file.

  • The file’s group may only write the file.

  • All others cannot access the file.


For 24-hour assistance any day of the year, contact our Support Team by email or through the Client Portal.

Article Rating (1 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
What are file and directory permissions?
Added on Wed, Nov 12, 2014
How to add FTP accounts with SiteWorx
Added on Mon, Jun 11, 2018
How to conserve disk space in Magento
Added on Fri, Jan 17, 2014
What is rsync?
Added on Mon, Feb 23, 2015
What is Subversion?
Added on Mon, Aug 18, 2014
How to set up FileZilla
Added on Mon, Jun 11, 2018
How to transfer files using WinSCP
Added on Fri, Aug 15, 2014
How to manage firewall whitelists in SiteWorx
Added on Wed, Nov 12, 2014
How to optimize JPEGs, PNGs, and GIFs from the CLI
Added on Tue, Jan 24, 2017
How to use FIleZIlla
Added on Mon, Jun 11, 2018