Let's assume the following structure of a folder called scripts.

├── scripts
│   └── .scripts
│       ├── script1
│       ├── script2
│       └── script3
│   └── .config
│       ├── script4
│       ├── script5
│       └── script6

When using stow scripts, both folders within scripts will be symlinked to ~/.scripts and ~/.config.

Can I use stow to only symlink .scripts without having to remove .config from the folder but just basically ignoring it?


stow has ignore lists which let you put a file called .stow-local-ignore at the top of your source tree. In that, you could put \.scripts to have stow ignore that directory and not link it into the target tree.

  • Excellent. Exactly what I was looking for. Thanks! – orschiro Mar 28 '14 at 7:40

Let's introduce some Stow terminology:

By default Stow takes the current directory is your stow directory, the name you type as the argument in the command line as the stow package and the parent dir as the target directory, so when you type:

$ stow scripts

Without any option your stow directory is the current directory, scripts is your package and the parent of current directory becomes the stow target directory where the package will appear to be installed(where the symlinks will be created).

You can explicitly inform the stow directory and the package you want to install in the command line like in the following command:

$ stow -d /path_to_scripts_folder/scripts -S .scripts

Where the scripts here is defined as your stow directory and .scripts as your package in Stow terminology.

Optionally you can specify the target directory, that is the directory relative to where your files(symlinks to your files) should be placed:

$ stow -d /path/scripts -S .scripts -t ~/

To test any of this options you can use the -n flag that just simulate the changes without modify your file system:

$ stow -n -d /path/scripts -S .scripts -t ~/

And if you want to see all actions that should be taken you can add the -v specifying a verbosity level from 0(no -v flag) up to 3(-vvv):

$ stow -n -d /path/scripts -S .scripts -t ~/ -vvv 

As this options become more and more complex it could be better to write a little shell script to automate your work and give you maximum of flexibility.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.