Introduction to Chmod in Linux and How to Change File Permissions
File permissions must be set up and managed in multi-user systems like How to Change File Permissions Recursively with chmod in Linux. Linux guarantees that only authorized users have access to the files they are supposed to.
Use the chmod command to modify a file’s permissions. Also, it enables recursive file permission changes so that you can set numerous files and subdirectories with a single command. How to Change File Permissions Recursively chmod linux?
Want to learn about more guides and get resources like this? Visit our Blog!
You will discover How to Change File Permissions Recursively with chmod in Linux. and how to use chmod recursively in this article:
- A terminal window or command line (Ctrl+Alt+F2 or Alt+T)
- An individual with sudo rights (optional)
- Linux Software

Powerful Hosting Solutions for Explosive Growth
Build a WordPress website the way you want it. ARZ Host provides even more user-friendly choices for portfolio and website creation.
Verify File Permissions
Use the following command to examine the file permissions in the working directory:
ls –l
All of the files in the directory’s permissions are listed in the output.
For instance, the Example directory has three files with identical permissions: test1.txt, test2.txt, and test3.txt (-rw-rw-r–).
According to the file permissions stated above, we know that:
- The owner has read-only and write-access rights.
- The owner’s group is granted read-and-write access.
- There are read-only users.
Related Article: How to Install Apache Tomcat on Linux? Step-by-Step Guide
Modify Permission Successively
The standard chmod command is frequently used to modify a single file’s permissions. But, it’s possible that you’ll need to recursively change the permission for each file in a directory.
In certain circumstances, the chmod recursive option (-R or —recursive) sets a directory’s permissions (and the files it contains).
The following syntax is used to recursively change a file’s permissions:
[Permission] chmod -R [Directory]
As a result, you would type: to give all files in the Example directory the 755 permission.
Example: sudo chmod -R 755
The command grants the owner read, write, and execute rights (7) and everyone else reads and executes rights (55). You mind need to find Hidden Files, See our detailed article on Showing Hidden Files in Linux to help you navigate.
With the find Command, modify the permission
The find command can be used to give directories and files different permissions.
Using the search command to find files or directories and then passing it on to chmod to set the permission are part of the fundamental syntax:
using the command sudo locate [directory] -type [d/f] -exec chmod [privilege];
1: The directory path containing the files and subdirectories you want to configure should be substituted for [directory].
2: Indicate whether the search is for a file or a directory (-type d or -type f).
3: Using the numerical or symbolic modes of the chmod command, set the file’s [permission].
Do not give files the ability to run. The following commands might be run in a typical configuration:
executing sudo find Example -type d -chmod 755;
execute the command sudo find Example -type f -chmod 644;
The files in this example have 644 (u=rw,go=r) access, whereas the directories have 755 (u=rwx,go=rx) privileges.
By entering the Example directory (cd Example) and displaying the contents, you can confirm that folders and files have various permission levels (ls -l). The result should resemble the following:
Modify Particular File Permissions Recursively
For modifying the permissions of files of a given type, combine the search command with chmod.

Powerful Hosting Solutions for Explosive Growth
Build a WordPress website the way you want it. ARZ Host provides even more user-friendly choices for portfolio and website creation.
The following command syntax can be used to modify a directory’s permissions for a particular file type:
"*. [filename extension]" search [directory] -exec chmod [privilege];
For instance, the following command might be used to make all.sh files in the current directory executable:
exe -name "*.sh" -chmod +x;
Conclusion
You should now be able to use the find command or the chmod -R command to recursively alter the file permissions on your Linux system.
How to Change File Permissions Recursively with chmod in Linux? Alternatively, you can modify the default permissions by using the mask command.
Looking for Reliable Hosting Services where that provide great customer service and help you set up your website or server? Look no further, ARZ Host provides this and more!
Latest Posts:
- How to Set Up a VPN on Your VPS: Step-by-Step Guide
- VPS vs Cloud Hosting – Which is Better?
- What is the Difference Between VPS and VPN? Explained
- How to Add a Domain to Your VPS: Step-by-Step Guide
- What is KVM VPS Technology? Comprehensive Overview