Stupid simple command to change ownership (chown) and change group (chgrp) at the same time. To simultaneously change both the owner and group of files or directories in linux use the following command structure:
- chown someusername:somegroupname filename.ext
You can man chown and man chgrp for more information on what those actually do and for further command options.
That’s it. I think that the way I was thinking about the question was not *nix friendly therefore there was no easily accessible answers in the SERPs. I’ll see if this pops up the next time I need to chown and chgrp at the same time.
One Response to “How to chown and chgrp at the same time”
FB
If you include the colon “:” but omit the group name it will assume whichever group the user belongs to.