Where my question originated:
- When running
cp source/files.all destination/
, all the files withinsource
will now also exist indestination
Question:
What if I didn’t want to duplicate the data from
source
intodestination
, but simply link them (with absolute path). Usually, I would run something like:for f in $(ls source/); do ln -s $(pwd)/${f} $(pwd)/destination; done
Is there a simple command/tool that I can use (e.g.
ln -a source/files.all destination/
) which would create a softlink to all files in a directory, while automatically adding the absolute path as prefix.ln -r
is close to what I need, but the absolute path, not the relative one?
Advertisement
Answer
So I eventually sort of found a simple way to do this:
Simply run ln -s $(pwd -P)/source/* destination/