From coreutils manual2.10 Traversing symlinksThe following options modify how chown and chgrp traverse a hierarchy  when the --recursive (-R) option is also specified. If more than one of the following options is specified, only the final one takes effect. These  options specify whether processing a symbolic link to a directory  entails operating on just the symbolic link or on all files in the  hierarchy rooted at that directory. These options are independent of  --dereference and --no-dereference (-h), which control whether to modify a symlink or its referent.-H If --recursive (-R) is specified and a command line argument is  a symbolic link to a directory, traverse it.-L In a recursive traversal, traverse every symbolic link to a  directory that is encountered.-P Do not traverse any symbolic links. This is the default if none  of -H, -L, or -P is specified.In These options are independent of--dereference and --no-dereference (-h), which control whether to modify a symlink or its referent, what do these options and --dereference and --no-dereference do respectively, and how are they different?The descriptions for -H and for -L seem to say the same thing to me. How are these two options different?Thanks.
Usage of options for symlinks in coreutils
symlink;coreutils
The -h flag (aka --no-dereference) is a good flag to use.  Let's say we have this setup:$ ln -s /etc/passwd /tmp/foobar$ sudo chown fred /tmp/foobarBecause --dereference is the default, this will actually change /etc/passwd... which is probably not what you want :-)  The -h flag would make it change the symlink ownership instead.  So you should get into the habit of using -h, especially if recursively changing ownership. i.e. do chmod -hR rather than chmod -R.The -H flag only applies to directory symlinks you list on the command line.  The -L option applies to all directory symlinks found, including those in subdirectories during a recursive chown.