In this post, let’s learn how to use chgrp and chown commands to change group and user ownership of a directory
On a Linux server, by default, the group owner of a file or directory is the primary group of the user who created the file directory. And it is highly likely in most cases the primary group and the user share the same name
Let’s say we need to change the group and user ownership of the directory /home/chris/mars to root user, below are the steps we need to execute
Step1: Switch to root user
#switch to the root user su - root
Note: In order to change the group owner of a file or directory, one must be the user owner of the file AND be a member of the group to which we are changing ownership or else be the root user. Also, remember that only the root user can change the user ownership of a file or directory.
Step2: Use chgrp to change the group owner and chown to change the user owner
#Using chgrp to change the group owner chgrp root /home/chris/mars #Using chown to change the user owner chown root /home/chris/mars
OR
Step3: Use chown to change both group owner and user owner at the same time
#using chown to change both group and user owner at the same time chown root:root /home/chris/mars
Here’s a bonus tip for you: The process to change group and user ownership on a file is the same as performing the commands on a directory, making our job easy!
Hello
Good share.
In my opinion the best iptv servers are those from Fishbone cccam
I would like to see more posts like this
Thanks
Настало, чтобы составить парочку планов
на ближайшее будущее. Я читал этот материал и, если необходимо, могу
порекомендовать вам немного интересных вещей или идей.
Возможно, вы могли бы написать последующие статьи относительно этой.
Я желаю читать еще больше материалов об этом!
Обожаю вещи, которые вы, ребята, так профессионально делаете.
Крутая работа и актуальные отчетности!
Ваш блог отличный Я добавил адрес страницы
в закладки! Ребята, вы , огромный респект!
Я не могу воздержаться и не прокомментировать.
Очень хорошо написано!
Я сейчас же запишу ваш rss, поскольку я не могу найти ваш email link или e-newsletter.
Можно ли попросить ваши контакты?
Будьте добры, позвольте мне общаться с вами для того, чтобы я мог бы подписаться.
Спасибо.
Я уверен, что сообщение затронет всех пользователей
авторского и действительно очень научного аккаунта.
Это стопроцентно фантастические идеи на тему блогов.
Вы затронули некоторые актуальные моменты здесь.
Так держать, пишите еще!