How to create shadow directory of symbolic links

There are times when it is handy to know how to create shadow directory of symbolic links. I am thinking in particular of the software compilation process, as I have used this technique in very distant past to build X Window System.

The required application is available in X Window System source code as lndir utility.

Installation process

The easiest way to obtain it is to install xutils-dev package.

$ sudo apt-get install xutils-dev

Alternatively you can download package source code, build required dependencies and compile only this utility.


Provide only source directory to create shadow directory in current work directory.

$ mkdir ags_build
$ cd ags_build
ags_build$ lndir ../ags 

Provide both source and destination directories to create shadow directory in provided location.

$ lndir /home/milosz/Projekty/ags /home/milosz/Projekty/ags_build/

It will recursively recreate directories and populate them with symbolic links pointing at the real files .

Additional notes

Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system. He is also open for new opportunities and challenges.

Gdansk, Poland