Skip to main content
5 of 5
deleted 22 characters in body
Mat
  • 54.9k
  • 11
  • 164
  • 143

transfer permissions user -> group/other

How do I transfer write/execute and execute permissions from owner to group and other, respectively?

I have some libraries I want to move to opt and set ownership of to root. Unfortunately, permissions are a bit messed up for group and other, and that creates a problem as group and other cannot use the libraries, call the executables and read the files.

I want to recursively set the permissions of write/execute and execute to group and other respectively. For example, I want this:

-rw-r--r--.   1 root root    4464 Jan 11 23:58 CPackSourceConfig.cmake
-rwxr--r--.   9 root root   28672 Jan 11 23:58 executable
drwxr--r--.   9 root root   28672 Jan 11 23:58 Source

to be this:

-rw-rw-r--.   1 root root    4464 Jan 11 23:58 CPackSourceConfig.cmake
-rwxrwxr-x.   9 root root   28672 Jan 11 23:58 executable
drwxrwxr-x.   9 root root   28672 Jan 11 23:58 Source

How do I best go about doing this, considering there are quite a number of files/folders (recursive)?

qonf
  • 113
  • 3