How to change the permission on all subdirectories and files in Unix [Quick Tip]

Share this article

Problem Scenario:

You are in a situation where you want to change the permission on all the files not only in current directories but also on all the files in subsequent subdirectories.

Solution:

The solution for this problem is to use the chmod command in recursive mode. The following command can be used:

chmod -R u+wx DirectoryPath

Where DirectoryPath is the path to the main directory. This command will change the permissions on all the files in the directory as well as all the subsequent directories to write and execute.

  • Archana Rajput

    Thanks