Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I symlink a file in Linux? [closed]

Tags:

linux

symlink

I want to make a symbolic link in Linux. I have written this Bash command where the first path is the folder I want link into and the second path is the compiled source.

ln -s '+basebuild+'/IpDome-kernel/kernel /home/build/sandbox/gen2/basebuild/IpDome-kernel/kernal 

Is this correct?

like image 818
chrisg Avatar asked Dec 23 '09 09:12

chrisg


4 Answers

To create a new symlink (will fail if symlink exists already):

ln -s /path/to/file /path/to/symlink

To create or update a symlink:

ln -sf /path/to/file /path/to/symlink
like image 67
hsz Avatar answered Oct 20 '22 20:10

hsz


ln -s TARGET LINK_NAME

Where the -s makes it symbolic.

like image 37
cyborg Avatar answered Oct 20 '22 21:10

cyborg


ln -s EXISTING_FILE_OR_DIRECTORY SYMLINK_NAME
like image 318
codaddict Avatar answered Oct 20 '22 22:10

codaddict


ln -s target linkName

You can have a look at the man page here:

http://linux.die.net/man/1/ln

like image 98
rui Avatar answered Oct 20 '22 21:10

rui