Changing Ownership of Files and Directories with chown

Suppose you’ve been working on a file called rowyourboat, and your boss decides to let a coworker, Merrilee, take over the project. In this case, to fully pawn off the project to your coworker, you need to change ownership of the file from you to her. Depending on how your system administrator set up the system, you can usually change ownership of files using chown (Code Listing 5.6).

Code Listing 5.6. Changing ownership of files transfers complete control.
[ejr@hobbes merrilee]$ ls -l
total 26
-rw-rw-r-       1 ejr          users     24850 Jul 24 15:17 rowyourboat
[ejr@hobbes merrilee]$ chown merrilee rowyourboat
[ejr@hobbes merrilee]$ ls -l total 26 -rw-rw-r- 1 merrilee users 24850 Jul 24 15:17 rowyourboat ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.