-3

I have a folder and it has files as below:

ls  /opt/data/incoming/test1

doc1.txt

doc2.txt

And I want to create a symlink for my folder test2 in following path: /run/opt/corp/mydir/test2

I tried to do with following command:

ln -sn  /opt/data/incoming/test1 /run/opt/corp/mydir/test2

But it didn't give me what I want. The symlinked file looks like:

ls /run/opt/corp/mydir/test2

test1

I was expecting to see files not folder. Here what I was expecting to see:

ls /run/opt/corp/mydir/test2

doc1.txt

doc2.txt

Could you please help to fix it? Thanks...

Gerhard
  • 22,678
  • 7
  • 27
  • 43

1 Answers1

0

Try adding wildcard in order to reference files inside of your source directory:

ln -s  /opt/data/incoming/test1/* /run/opt/corp/mydir/test2
Zumo de Vidrio
  • 2,021
  • 2
  • 15
  • 33