How do I change owner and group owner of files and directories?

406 Views Asked by At

I want to change the owner and the group owner for all the files in the current working directories with a single line command. I don't want to have double line as follows;

sudo chown you <some_file> chgrp new_group some_file

2

There are 2 best solutions below

0
Gedge On BEST ANSWER

sudo chown you:new_group some_file

0
Paco Hdez On

Try this piece of code

sudo chown new_user:new_group *

sudo = super user do chown = change owner '*' = target all the files in the working directory