LogoopenSUSE Build Service > Projects
Sign Up | Log In

lns - symbolic link creation utility
http://www.chiark.greenend.org.uk/~sgtatham/utils/

lns creates symbolic links.

The standard command ln -s also does this, but it interprets its first argument as the literal text to be placed in the symlink. If your current working directory is not the same as the target directory, this can get confusing. For example, to create a symlink to a file hello.c in a subdirectory programs, you would have to write ln -s ../hello.c programs, even though hello.c is actually in your current directory, not one level up. In particular, this is unhelpful because it makes it difficult to use tab completion to set up the command line.

lns solves this problem, by creating symlinks using the obvious semantics you would expect from mv or cp. All of its arguments are expected to be either absolute path names, or relative to the current working directory. So, in the above example, you would write lns hello.c programs/hello.c or just lns hello.c programs, exactly as you would have done if the command had been cp; and lns will figure out for itself that the literal text of the symlink needs to be ../hello.c.

lns also has a mode in which it will create a symlink mirror of an entire directory tree: that is, instead of creating a single symlink to the root of the tree, it will create directories in the same structure as the whole of the original tree, and fill them with individual symlinks to the files. This is occasionally handy if you want to work with a slightly modified version of a large file hierarchy but you don't want to waste the disk space needed to create an entirely separate copy: you can symlink-mirror the whole tree, and then just replace one or two of the symlinks with modified versions of the files they point to.

Source Files

Filename Size Changed Actions
lns.spec 2.45 KB about 8 years ago Download File
lns.tar.gz 8.8 KB about 8 years ago Download File

Comments for home:aljex (0)