From 52e93d57016911e022d4077e098c3a8584f386ae Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 7 Jun 2005 06:40:40 +0000 Subject: (ln invocation): Examples, from Bob Proulx. --- doc/coreutils.texi | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'doc') 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 -- cgit v1.2.3-70-g09d2