S.K.
S.K.

Reputation: 77

Symlink existing directory

I have an app in /usr/abc and I want to link the abc app to /dump/abc (this is an existing directory). When I run ln -s /usr/abc /dump/abc the link is created inside /dump/abc/abc directory. But I need the content of /usr/abc to be in /dump/abc and not in /dump/abc/abc.

When I do ls -l /dump/abc, I get

lrwxrwxrwx 1 root root 15 Dec 11:00 abc -> /usr/abc 

The desired result when I do ls -l /dump/abc is the content of /usr/abc.

Can someone help me here?

Upvotes: 2

Views: 147

Answers (1)

alecxs
alecxs

Reputation: 741

if your intention is to preserve existing /dump/abc you can bind-mount /usr/abc. when done umount /dump/abc to restore the previous state

mount -o bind /usr/abc /dump/abc

Upvotes: 2

Related Questions