summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-06-07 06:40:40 +0000
committerJim Meyering <jim@meyering.net>2005-06-07 06:40:40 +0000
commit52e93d57016911e022d4077e098c3a8584f386ae (patch)
tree42407fc7679fc5a08f04939bab36fddf388c93f8 /doc
parent33adc501ab375c88b48460d9ade52206228d52fb (diff)
downloadcoreutils-52e93d57016911e022d4077e098c3a8584f386ae.tar.xz
(ln invocation): Examples, from Bob Proulx.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi27
1 files changed, 21 insertions, 6 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index dd019422b..4b2fe80a7 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -7741,14 +7741,29 @@ Print the name of each file before linking it.
Examples:
@smallexample
-# Create link ./name pointing to /some/name.
-ln -s /some/name
+Bad Example:
-# Create link ./myname pointing to /some/name.
-ln -s /some/name myname
+# Create link ../a pointing to a in that directory.
+# Not really useful because it points to itself.
+ln -s a ..
-# Create links ../a and ../b pointing to ./a and ./b.
-ln -s a b ..
+Better Example:
+
+# Change to the target before creating symlinks to avoid being confused.
+cd ..
+ln -s adir/a .
+
+Bad Example:
+
+# Hard coded paths don't move well.
+ln -s $(pwd)/a /some/dir/
+
+Better Example:
+
+# Relative paths survive directory moves and also work across
+# networked filesystems.
+ln -s afile anotherfile
+ln -s ../adir/afile yetanotherfile
@end smallexample