Change a file's owner with chown on Mac
Take ownership of files left behind by other users or migrated accounts.
Run the command below with your username — you become the owner and can freely rename or delete the file.
01Command
Command
$ sudo chown $(whoami) ~/Documents/oldfile.txt02What it does
Files copied from another Mac or an old account can carry a previous owner, blocking edits even for admins. chown reassigns ownership; $(whoami) substitutes your short username. Add -R to apply to a whole folder (sudo chown -R $(whoami) ~/folder). Use Finder's Get Info Sharing & Permissions pane for a visual alternative.
03Risk
!Warning: Avoid chown on system folders (/System, /usr) — changing ownership there can break macOS.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- chown(8) man pageEvidence: Documents chown ownership syntax and the -R recursive variant.
- macOS chown command referenceEvidence: chown changes the file owner and group; the owner may be given as user or user:group.
Last verified: 2026-09-19 · Category: Files & Folders
06Related solutions
Find files larger than 500 MB on Mac
List the biggest files in your home folder that are eating disk space.
Batch-rename file extensions on Mac (jpeg → jpg)
Change the extension of every matching file in a folder with one shell loop.
Hide any file or folder on Mac
Make a file or folder invisible in Finder without moving or renaming it.