Skip to main content

CHMOD

>>>>>>>>>>>>>>>>>>>>>>>>>>What does CHMOD mean ?

CHMOD is one of the most important and oldest commands in the Linux environment and has been around since the first AT&T UNIX release in the 1970s. The command is entered directly in the shell or bash window. It changes the access rights of files and folders. Closely related commands are:

  • chown (owner of a file)
  • chgrp (group membership of a file)
  • chattr (rights management on ext2 and ext3 UNIX systems)

The program is preinstalled in all major Linux distributions today and can be found in the Coreutils package. Tip: Before making changes to file permissions, the current state should be examined and backed up. If after the permission changes Applikationen no longer run, can be reset in an emergency. The current access rights to files and folders are displayed with the following command:

ls -al /home (lists all files in the Home directory and their permissions).

Linux then generates a list with the following structure:
-rw-r–r– 1 name name 0 2019-01-20 14:30 /home/name/test.txt

The following abbreviations for access rights are possible:
– (rights not set)
r (read permissions)
w (write permissions)
x (rights to execute the file)

With the CHMOD command, these permissions can now be set directly, supplemented with a plus or deleted with a minus. U stands for user, g stands for group. Two examples:

  • CHMOD +x TestScript.sh (makes the file TestScript.sh executable for all users)
  • CHMOD u=rw,g=rw,o=r test.txt (sets the permissions for owner and group to read and write, others may only read)

Do you have any more questions?

Please contact us


Further contents