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).

To change ownership with chown:

1.
ls -l
For starters, type ls -l at the shell prompt to verify the file's name and ownership, as in Code Listing 5.6. Remember that the ownership information is located after the permissions and linking information.
2.
chown merrilee rowyourboat
Type chown followed by the userid ...

Get Unix: 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.