PDA

View Full Version : what does -H mean,when use ls?



lch3920126
7th September 2006, 11:07 AM
what does -H mean,when use ls?
I have used "man ls",But I don't konw what it say.

pete_1967
7th September 2006, 12:20 PM
`-H'
`--dereference-command-line'
If a command line argument specifies a symbolic link, show
information for the file the link references rather than for the
link itself.


For example:


[12:19:17 @dhcp-104 ~]$ ls -l /etc/openoffice.org-2.0
lrwxrwxrwx 1 root root 22 Dec 8 2005 /etc/openoffice.org-2.0 -> /opt/openoffice.org2.0
[12:19:20 @dhcp-104 ~]$ ls -H /etc/openoffice.org-2.0
help licenses README share
LICENSE presets README.html THIRDPARTYLICENSEREADME.html
LICENSE.html program readmes
[12:19:25 @dhcp-104 ~]$


See how '-H' option lists the contents of the directory the symlink is pointing to and '-l' option gives you information about the link itself.