• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How does “chmod -R 755” works

by admin

The permissions bits applied to a file system object correspond directly to the values which can be specified in the 4 digit tuple supplied to the chmod utility in the following command:

# chmod abcd [file system object]

Each value in the digit set abcd is made up of a sum of the values 1 2 and 4. By adding these values together for each digit, a value can be generated to set all file object attributes:

a – This digit controls special attribute settings. the value 1 sets the setuid bit, the value 2 sets the setgid bit, and the value 4 sets the sticky bit on the object.

b, c and d – These digits control read write and execute permissions for the file owner, the file owners primary group, and all other users. The value 4 enables read permission, the value 2 enables write permission, and the value 1 enables execute permission.

chmod -R 755

The -R option gives the permission recursively to all the files and folders under a directory. For example:

# chmod -R 755 /data01

The above command will recursively give 755 permission to /data01 directory along with all the files and directories present under it.

Other examples

1. To set a file file to be sticky, readable and writeable by the owner, readable by their primary group and inaccessible by everyone else:

# chmod 4610 filename

2. To give all permission to everyone on the system:

# chmod 0777 filename

For more information on chmod, see the chmod man page.

# man chmod

Filed Under: Linux

Some more articles you might also be interested in …

  1. hangups Command Examples
  2. “shutdown” Command Examples in Linux
  3. home-manager Command Examples
  4. How to move /usr and /var to Another Partition or Disk
  5. airodump-ng – Capture packets and display information about wireless networks (Command Examples)
  6. ldapsearch Command Examples
  7. logrotate Command Examples in Linux
  8. How to disable auto deletion of the files in /tmp and /var/tmp directories in CentOS / RHEL 5,6
  9. i3-scrot Command Examples in Linux
  10. i3status Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright