Easy Tutorial
❮ Linux System Boot Linux Comm Netstat ❯

Linux chown Command

Linux Command Manual

The Linux chown (full spelling in English: change owner) command is used to set the file owner and associated group.

Linux/Unix is a multi-user, multi-tasking operating system where all files have an owner. The chown command is used to change the owner of specified files to a designated user or group. The user can be a username or user ID, and the group can be a group name or group ID. The files are a space-separated list of files to change permissions for, and it supports wildcard characters.

The chown command requires superuser root privileges to execute.

Only the superuser and the file owner belonging to the group can change the file's associated group. Non-superusers may need to use the chgrp command to set the associated group.

Usage Permissions: root

Syntax

chown [-cfhvR] [--help] [--version] user[:group] file...

Parameters:

Examples

chown root /var/run/httpd.pid

Set the owner of the file file1.txt to tutorialpro and the group to tutorialprogroup:

chown tutorialpro:tutorialprogroup file1.txt

Set the owner of all files and subdirectories in the current directory to tutorialpro and the group to tutorialprogroup:

chown -R tutorialpro:tutorialprogroup *

Set the associated group of /home/tutorialpro to 512 (group ID) without changing the owner:

chown :512 /home/tutorialpro

Linux Command Manual

❮ Linux System Boot Linux Comm Netstat ❯