Created
October 21, 2022 16:34
-
-
Save feynlee/e0e5896851b8d985687f223d7f4ea19f to your computer and use it in GitHub Desktop.
change ownership and permissions in Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # change owner of folder (-R: recursively) to user1 | |
| chmod -R user1 folder | |
| # create a new group and add user1 and user2 to it | |
| sudo groupadd newgroup | |
| sudo usermod -aG newgroup user1 | |
| sudo usermod -aG newgroup user2 | |
| # change group ownership of folder to newgroup | |
| sudo chgrp -R newgroup folder | |
| # give permission to the new group | |
| sudo chmod -R g+rwx folder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment