- Forums
- Linux Hosting
- Shell Command: Changing Owner And Group At The Same Time In Linux
today i will show you how you can change ower and group with the chown command in linux [532], Last Updated: Sat May 18, 2024
mel
Tue Jul 12, 2011
0 Comments
574 Visits
today i will show you how you can change ower and group with the chown command in linux
very simple, lets say i have a file called myfriends.txt and the owner is OldUser and group is OldGruop and i want to change the owership to NewUser and NewGroup. to so change:
FROM:
OldUser OldGroup myfriends.txt
TO:
OldUser OldGroup myfriends.txt
i would use this command:
LINUX SHELL COMMAND:
chown OldUser:OldGroup myfriends.txt
if i had a directory called myfriends/ i would change all the files in that directory with this command:
COMMAND:
chown -R OldUser:OldGroup myfriends/
hope that helps