How to Change a File's Owner on Linux

With chown, including the recursive option for entire folders.

Intermediate 1 min read Published on 2026 By Equipo SolucionaPC
sudo chown newuser file.txt

Also changing the group

sudo chown newuser:newgroup file.txt

Applying it to an entire folder (with its contents)

sudo chown -R user:group /path/to/folder

-R (recursive) applies the change to the folder AND everything it contains inside, not just the folder itself.

Tip: the most common case where you need this is after copying files from another user account or from an external drive — they often keep the original owner, not yours, until you change it explicitly.

Frequently asked questions

Why do files copied from an external drive have a different owner?

They keep the original owner and permissions from where they came from — it's common to need to change them manually with chown after copying them, so they're fully yours on the new system.

What does the -R option do in chown?

It applies the owner change recursively — to the specified folder and to all its internal contents, not just the folder itself.

Share: