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?
How to create symlink in vagrant. Steps:
To the original question:
This will indeed create a symbolic link (
-s
) from the file/directory:to your new link
Here's a few ways to help you remember:
First, there's the man page for
ln
. You can access this via searching "man ln" in google, or just open a terminal window and typeman ln
and you'll get the same information. The man page clearly states:If having to search or read through a man page every time isn't for you, maybe you'll have an easier time remembering that all nix commands work the same way:
cp
copies a file that currently exists (the first argument) to a new file (the second argument).mv
moves a file that currently exists (the first argument) to a new place (the second argument)Likewise
ln
links a file that currently exists (the first argument) to a new link (the second argument)*The final option I would like to suggest is you can create your own man pages that are easy to read and easy (for you) to find/remember. Just make a simple shell script that gives you the hint you need. For example♦:
In your .bash_aliases file you can place something like:
Then when you need it, from the command line just type
cmds
and you'll get back the proper syntax in a way you can quickly read and understand it. You can make these functions as advanced as you'd like to get what what information you need, it's up to you. You could even make them interactive so you just have to follow the prompts.. something like:* - well obviously they can all take different parameters and do different things and can work on files as well as directories... but the premise is the same
♦ - examples using the bash shell
You can have a look at the man page here:
http://linux.die.net/man/1/ln
ln -s sourcepath linkpathname
Note:
-s makes symbolic links instead of hard links
links are basically of two types :
symbolic links(Soft): link to a symbolic path indicating the abstract location of another file
hard links : link to the specific location of physical data.
Example 1: ln /root/file1 /root/file2
Above is an example of hard link where you can have a copy of your physical data.
Example 2: ln -s /path/to/file1.txt /path/to/file2.txt
Above command will create a symbolic link to file1.txt.
If you Delete a source file than you won't have anything to the destination in Soft
when you do :
ls -lai
You'll see that there is a different inode number for the symlinks .
For more details you can read man of ln on your linux os.
Thanks