LinuxCommandLibrary

stow

TLDR

Stow a package (create symlinks)

$ stow [package]
copy
Stow to specific target
$ stow -t [/target/directory] [package]
copy
Unstow a package (remove symlinks)
$ stow -D [package]
copy
Restow (unstow then stow)
$ stow -R [package]
copy
Simulate stow (dry run)
$ stow -n [package]
copy
Stow with verbose output
$ stow -v [package]
copy
Stow from specific directory
$ stow -d [/path/to/stow/dir] [package]
copy
Adopt existing files
$ stow --adopt [package]
copy

SYNOPSIS

stow [options] package...

DESCRIPTION

stow is a symlink farm manager that creates symbolic links from a source tree to a target directory. It's commonly used to manage dotfiles, organize software installed in /usr/local, and maintain configuration files.
Packages are directories containing files organized as they should appear in the target. Stow creates symlinks in the target directory pointing to files in the package directory, maintaining the directory structure.
For dotfiles management, stow directories typically mirror home directory structure, allowing version control of configurations while keeping them active via symlinks.

PARAMETERS

-d dir, --dir= dir

Stow directory (default: current).
-t dir, --target= dir
Target directory (default: parent of stow dir).
-S, --stow
Stow packages (default action).
-D, --delete
Unstow packages.
-R, --restow
Restow (unstow then stow).
-n, --no, --simulate
Dry run, don't make changes.
-v, --verbose
Increase verbosity.
--adopt
Adopt existing files into package.
--ignore= regex
Ignore files matching pattern.
--defer= regex
Defer to existing files.
--override= regex
Override existing files.

CAVEATS

Doesn't handle conflicts automatically. Target directory must exist. Symlinks point to absolute paths by default. Some applications don't follow symlinks properly. Adopt mode moves files, potentially causing issues.

HISTORY

GNU Stow was written by Bob Glickstein in 1993 to manage software compiled into separate directories. It was initially designed for /usr/local/stow organization. The tool was later adopted by the dotfiles management community for organizing configuration files under version control.

SEE ALSO

ln(1), dotfiles(1), chezmoi(1), yadm(1)

Copied to clipboard