View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Matthew Musgrove > File-LinkDir-1.02 > link-files


Annotate this POD



Open  1
View/Report Bugs


link-files - Create symlinks in one directory for files in another


link-files <options>

  -n, --dry-run             Don't actually do anything
  -s DIR, --source=DIR      The source directory
  -d DIR, --dest=DIR        The destination directory
  -r, --recursive           Recurse into subdirectories (see below)
  -i RX, --ignore=RX        A regex matching files to ignore (see below)
  -a RX, --add-ignore=RX    Like -i but doesn't replace the default
  -f, --force               Overwrite existing files/dirs
  -h, --hard                Use hard links instead of symlinks
  -?, --help                Display this help message
  -v, --version             Display version information

By default, link-files will create symlinks in the destination directory for all top-level files, directories or symlinks found in the source directory. This is very useful for keeping the dot files in your $HOME under version control. A typical use case:

 cd ~/src/dotfiles
 # update or add files, commit to repository
 link-files --source . --dest ~

With --recursive, link-files will not create symlinks to subdirectories found in the source directory. It will instead recurse into them and create symlinks for any files or symlinks it finds. Any subdirectories not found in the destination directory will be created. This approach is useful for destination directories where programs or users other than yourself might add things to subdirectories which you don't want ending up in your working tree implicitly. /etc is a good example.

In both cases, symlinks from the source directory will be copied as-is. This makes sense because the symlinks might be relative.

If --ignore is not specified, it defaults to ignoring .git and .svn directories and their contents.

See File::LinkDir for complete details.


Hinrik Örn Sigurðsson, <> Matthew Musgrove, <>


Copyright (c) 2009-2010 the File::LinkDir "AUTHOR" as listed above.


This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.

syntax highlighting: