Reputation: 425
We are creating a soft link using below command.
ln -sf /home/root/Test "/home/root/TestSoftLink"
So our TestSoftLink will be pointing to /home/root/Test
TestSoftLink -> /home/root/Test
Our requirement : When we do ll
under /home/root/
TestSoftLink should point to Test (Without parent directories) like below
TestSoftLink -> Test
Note : both Test and TestSoftLink should be present under /home/root/
Is it possible?
Upvotes: 5
Views: 3560
Reputation: 40685
The ln -s
command simply takes the string of the first argument, and writes it into the symbolic link. As such, it is perfectly valid to do this:
ln -sf Test "/home/root/TestSoftLink"
There is no need to do a cd
.
Upvotes: 4
Reputation: 425
As @cuihtlauac mentioned , We used below command and it worked !
cd /home/root; ln -sf Test TestSoftLink
Upvotes: 2