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).
[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 [ejr@hobbes merrilee]$ |
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 of the person you want to transfer ownership to and the filename. In this case, the chown command changes the ownership for rowyourboat to merrilee. rowyourboat and its associated problems will now be hers, and life will be but a dream. |