.. _ownership: Setting User and Group Ownership of Files ------------------------------------------ :t:`Linux for Programmers and Users`, Sections 3.31 and 3.32 .. _chown: :command:`chown` ^^^^^^^^^^^^^^^^^ .. index:: chown .. program:: chown .. describe:: chown Change ownership of files (super user only) SYNOPSIS :command:`chown` [-R] newowner FILE... .. _newgrp: :command:`newgrp` ^^^^^^^^^^^^^^^^^ .. index:: newgrp .. program:: newgrp .. describe:: newgrp Change the shell's group ID. When you first log into the system, your group ID is set to your default group. Any files or directories that you create will have this group ownership. They can later be changed to belonging to a different group using :ref:`chgrp`. However, if you will begin working on a project where you want to share anything created, it may be simpler to use the :command:`newgrp` command first, so that all new files and directories will be owned by the specified group. SYNOPSIS :command:`newgrp` group :: $ groups tim cmst270 $ id uid=500(tim) gid=500(tim) groups=500(tim),537(cmst270) $ newgrp cmst270 $ id uid=500(tim) gid=537(cmst270) groups=500(tim),537(cmst270) $ touch foo1 $ ls -ld foo1 -rw-r--r-- 1 tim cmst270 0 Sep 3 13:57 foo1 .. note:: :command:`newgrp` will sometimes prompt for a password. To make it not prompt for a password, the systems administrator must remove the entry for the group from the ``/etc/gshadow`` file. .. _chgrp: :command:`chgrp` ^^^^^^^^^^^^^^^^^^ .. index:: chgrp .. program:: chgrp .. describe:: chgrp Change the group ownership of each FILE to GROUP SYNOPSIS :command:`chgrp` [-R] GROUP FILE... .. option:: -R, --recursive operate on files and directories recursively .. Seealso:: Now complete :ref:`hw4`.