Page 190 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 190

Network Operating Systems-I




                    notes          Where an absolute pathname starts from the root directory and leads to its destination, a relative
                                   pathname starts from the working directory. To do this, it uses a couple of special symbols to
                                   represent relative positions in the file system tree. These special symbols are “.” (dot) and “..”
                                   (dot dot).




                                      Note     The “.” symbol refers to the working directory and the “..” symbol refers to the
                                     working directory’s parent directory.


                                   10.3.3 change ownership

                                   The chown command changes the ownership of a file or files. This command is a useful method
                                   that root can use to shift file ownership from one user to another. An ordinary user may not
                                   change the ownership of files, not even her own files.
                                         chown [Options]... NewOwner File...

                                         chown [Options]... :Group File...
                                         chown [Options]... --reference=RFILE File...
                                   chown changes the user and/or group ownership of each given file, according to its first non-
                                   option argument, which is interpreted as follows. If only a user name (or numeric user ID) is
                                   given, that user is made the owner of each given file, and the files’ group is not changed. If the
                                   user name is followed by a colon or dot and a group name (or numeric group ID), with no spaces
                                   between them, the group ownership of the files is changed as well. If the colon or dot and group
                                   are  given, but the user name is omitted, only the group of the files is changed; in this case, chown
                                   performs the same function as chgrp.
                                   options:
                                   -c
                                   --changes

                                   Verbosely describe the action for each FILE whose ownership actually changes.
                                   --dereference
                                   Do not act on symbolic links themselves but rather on what they point to.
                                   -f
                                   --silent

                                   --quiet
                                   Do not print error messages about files whose ownership cannot be changed.
                                   -h
                                   --no-dereference

                                   Act on symbolic links themselves instead of what they point to. This is the default.  This mode
                                   relies on the ‘lchown’ system call. On systems that do not provide the ‘lchown’ system call, ‘chown’
                                   fails when a file specified on the command line is a symbolic link. By default, no diagnostic is
                                   issued for symbolic links encountered during a recursive traversal, but see ‘--verbose’.
                                   --reference=FILE
                                   Use the user and group of the reference FILE instead of an explicit NewOwner value.




          184                              LoveLy professionaL university
   185   186   187   188   189   190   191   192   193   194   195