Skip to content
Beacon Soft

Beacon Soft

Uncover Technology Facts, Explore Phones, and Dive into Video Games

Primary Menu
  • Home
  • Phone Facts
  • Tech Town
  • Tips For Tech-Heads
  • Games We Like
  • Latest
  • Contact the Team
  • Home
  • Latest
  • How to change file permissions recursively using Chmod in Linux?

How to change file permissions recursively using Chmod in Linux?

Ronda Mcanne December 1, 2021 4 min read
2172

Chmod is an Unix command that allows users to change permissions of files and directories. You can use it recursively or non-recursivey, depending on your needs, but there are some things you need to know about the recursive mode. This tutorial will teach you how to use Chmod in a recursive way without any help from additional commands such as find and xargs.,

The “linux change folder permissions from root to user” is a question that has been asked many times. In this article, I will show you how to do it with the command line tool called “chmod”.

If you use Linux, you’re going to run into permission difficulties at some point. In most cases, these issues may be fixed by giving the file you’re attempting to alter the proper user rights or ownership.

In this tutorial, we’ll look at how to use the chmod command in Linux to recursively alter permissions on files and directories.


The chmod command in Linux allows you to modify file permissions. Permissions may be given in either a symbolic or numerical format. Because the command only works on files, you’ll have to use the –R or (–recursive) parameter to modify the permissions of a whole folder.

The chmod command has the following general syntax.

[permissions] chmod -R [directory]

When you’re operating a local web server on your Linux system, maybe the most common situation for modifying file permissions is. You’ll need to adjust a few file permissions to make them viewable across your local network in this situation. The chmod command will be used as follows.

/var/html/www/chmod -R 755

The permissions are represented by 755 in the command above. In symbolic mode, the same permissions might be mentioned as follows.

/var/www/html/chmod -R u=rwx,go=rx

Keep in mind that file permissions may only be changed by the root owner or users with sudo rights.

In the samples above, u stands for the current user, g for the group, and o for the others. The letters r, w, and x stand for read, write, and execute permissions, respectively. = creates a new permission, + adds a permission, and – revokes a permission.

Permissions and owners are defined by numbers in numeric mode. The numerical representation of each number is shown below.

  • 0: There is no authorization.
  • 1: Put it into action
  • 2: Write
  • 4: Read

The sum of values for a given user class represents the authorization number for that group. If you wish to provide a user read, write, and execute rights, for example, the permission number is 4+2+1 = 7.

As a result, the user in the examples has read, write, and execute rights, but the group and owner only have read and execute capabilities.

Also see: What Does the Linux Booting Process Entail?


If you want to alter the permissions of a certain file type inside a folder, you’ll need to use the search command to locate the file and then use chmod to change the permissions.

Using our webserver as an example, here’s how you’d modify all files with permissions of 644 to 755.

find /var/www/html -type d -exec chmod 755; find /var/www/html -type f -exec chmod 644; find /var/www/html -type d -exec chmod 755; find /var/www/html -type f -exec chmod 644;

The same thing may be done in symbolic style, as seen here.

find /var/www/html -type d -exec chmod u=rwx,go=rx; find /var/www/html -type f -exec chmod u=rw,go=r; find /var/www/html -type f -exec chmod u=rw,go=r;

See also: How to rename a directory in Linux.

When he’s not writing/editing/shooting/hosting all things tech, he streams himself racing virtual vehicles. Yadullah may be reached at [email protected], or you can follow him on Instagram or Twitter.

Watch This Video-

“chmod recursive directories and files” is a command that allows users to change file permissions recursively. This can be done by using the “chmod” command with the “-R” option. The “-R” option means that it will apply to all directories and files in the current directory.

{“@context”:”https://schema.org”,”@type”:”FAQPage”,”mainEntity”:[{“@type”:”Question”,”name”:”How do I change permissions on a Linux file recursively?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”A: Use the following command to change permissions on a file recursively:
sudo chmod 666 filename”}},{“@type”:”Question”,”name”:”How do you apply chmod 777 recursively?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”A: chmod 777 recursively is usually used to change permissions of directories and files. It changes the permission setting on all folders and data within that folder and can also be applied to individual items in a given directory.”}},{“@type”:”Question”,”name”:”How do I change permissions in Linux chmod?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”A: There is no way to change permissions in Linux chmod.”}}]}

Frequently Asked Questions

How do I change permissions on a Linux file recursively?

A: Use the following command to change permissions on a file recursively:
sudo chmod 666 filename

How do you apply chmod 777 recursively?

A: chmod 777 recursively is usually used to change permissions of directories and files. It changes the permission setting on all folders and data within that folder and can also be applied to individual items in a given directory.

How do I change permissions in Linux chmod?

A: There is no way to change permissions in Linux chmod.

Related Tags

  • chmod 777
  • chmod recursive directories only
  • chmod 777 recursive
  • chmod recursively
  • chmod command in linux

Continue Reading

Previous: The 7 Best Blue Light Glasses For Large Heads
Next: Qualcomm announces next-gen flagship Snapdragon 8 Gen 1 SoC

Trending tech posts

How to fix why does spotify take up so much space on my computer 1

How to fix why does spotify take up so much space on my computer

Ronda Mcanne August 7, 2022
Floating Screenshots on Mac 2

Floating Screenshots on Mac

Ronda Mcanne August 5, 2022
How to check how many songs are on your iTunes 3

How to check how many songs are on your iTunes

Ronda Mcanne August 3, 2022
How to rename a folder on your Mac in seconds 4

How to rename a folder on your Mac in seconds

Ronda Mcanne August 1, 2022

Related Stories

The Startup Portfolio! Thinking Like a Trader About Your Ventures
5 min read

The Startup Portfolio! Thinking Like a Trader About Your Ventures

nina May 8, 2025 17
Using Kraken’s Ethereum Price Charts for Strategic Trading to Maximize Returns Image3
3 min read

Using Kraken’s Ethereum Price Charts for Strategic Trading to Maximize Returns

Ben Austin May 7, 2025 18
Counter-Strike Skins: Digital Collectibles With Real Staying Power Image1
4 min read

Counter-Strike Skins: Digital Collectibles With Real Staying Power

Daniel Myers May 4, 2025 33
Reasons Demand Forecasting Software Makes a Difference in Retail
5 min read

Reasons Demand Forecasting Software Makes a Difference in Retail

Ronda Mcanne May 1, 2025 47
Staying Ahead of the Exploit Curve: How Businesses Can Respond to the Surge in Cyber Vulnerabilities Image1
4 min read

Staying Ahead of the Exploit Curve: How Businesses Can Respond to the Surge in Cyber Vulnerabilities

Ben Austin April 30, 2025 55
Cryptocurrencies and Cryptocurrency Exchanges: A Comprehensive Guide Image1
3 min read

Cryptocurrencies and Cryptocurrency Exchanges: A Comprehensive Guide

Ronda Mcanne April 28, 2025 65

more on beaconsoft

Social Media: Facebook Emoticons recargapay 70m series 100mmccarthytechcrunch
4 min read

Social Media: Facebook Emoticons

Xyldorath Grintal October 3, 2022 3101
For businesses looking to maximize their presence in the world of social media, engaging a Los Angeles...
Read More
Latest Gear: Apple Airpods social irl 10m augustpereztechcrunch

Latest Gear: Apple Airpods

Ronda Mcanne October 3, 2022
Aesthetic tips for your phone zillow showingtime 500m q4

Aesthetic tips for your phone

Xyldorath Grintal September 28, 2022
Get the new iPhone 8 and learn how to use Airdrop

Get the new iPhone 8 and learn how to use Airdrop

Jyndaris Varlith August 26, 2022
A guide to hide and show posts on Instagram

A guide to hide and show posts on Instagram

Jyndaris Varlith August 23, 2022

Our Location: 7345 Zynlorin Avenue, Qylathor, MA 47829

  • Privacy Policy
  • T & C
  • About the Crew
  • Contact the Team
Beacon Soft © All rights reserved.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT