Change owner for directory recursively: sudo chown -R user:group /path/to/directory Chown is a short for “change owner”, -R – means “recursively”, owner and group definition are separated by “:”. Also we need high privileges to run chown command – so we use “sudo”. Change permissions only for directories recursively: find /path/to/directory -type d -exec chmod 755 {}Continue Reading
Tag: Permissions
How to make an immutable file
As we already know, files have access right matrix (read more in this article: “File and directory permissions in Linux / FreeBSD / MasOS“). But that’s not all. There are more mechanisms for accessing files. For example, we can change file’s attributes. One of them is immutability attribute. Users with high capabilities can set /Continue Reading
File and directory permissions in Linux / FreeBSD / MasOS
According to the Unix philosophy “Everything is a file”. And it is. But sometimes it’s difficult to understand all the rules to provide this statement. Let’s start from the most common problems that developers have when working with Unix-like file systems! Basic commands for setting file permissions To recursively change directories’ owner and group, useContinue Reading