Skip to main content

Command referencechown

chown command (Linux / bash / sh / zsh)

Linuxbashshzshpermissionsintermediate

What it does

Change the owning user and group of filesystem entries. When people search for the chown command linux ownership, they usually want chown's everyday flags, safe examples, and how it differs from related tools. Below you'll find syntax, options, and copyable examples for Bash/sh/zsh.

Change the owning user and group of filesystem entries.

Syntax

chown [OPTION]... [OWNER][:[GROUP]] FILE...

Common options

Flag / optionMeaning
-RChange ownership recursively.
-hChange a symbolic link rather than its target.
--from=OLDChange only entries with matching current ownership.
--reference=FILECopy owner and group from a reference file.

Practical examples

Change owner

sudo chown alice report.txt

Assigns the file to user alice.

Owner and group

sudo chown alice:developers app/

Changes both owner and group.

Fix a tree

sudo chown -R www-data:www-data /var/www/app

Updates ownership throughout a web directory.

Common mistakes

  • Running recursive chown from the wrong directory.
  • Omitting the group when both owner and group need correction.

FAQ

What does chown do in Linux?

Change the owning user and group of filesystem entries.

How do I use chown from the terminal?

Start with `chown [OPTION]... [OWNER][:[GROUP]] FILE...`, then choose only the options needed for the task.

What is a practical chown example?

Try `sudo chown alice report.txt` — Assigns the file to user alice.

Can I use chown in a shell script?

Yes. chown works in Bash, sh, and Zsh, but scripts should handle quoting, errors, and command output explicitly.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.