chown – change file/directory ownership

IMPORTANT: chown needs to be run as root.

chown example

As root user, let’s create a file named try:

[root@rhel8 /home/greys]# touch try

it belongs to user root and group root:

[root@rhel8 /home/greys]# ls -al try
-rw-r--r--. 1 root root 0 Feb 20 06:44 try

Now let’s change ownership to user greys and group wheel

[root@rhel8 /home/greys]# chown greys:wheel try
[root@rhel8 /home/greys]# ls -al try
-rw-r--r--. 1 greys wheel 0 Feb 20 06:44 trl

See Also




Keep Learning

Follow me on Facebook, Twitter or Telegram:
Recommended
I learn with Educative: Educative
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets