To the original question:
ln -s +basebuild+ /IpDome-kernel/kernel /home/build/sandbox/gen2/basebuild/IpDome-kernel/kernal
This will indeed create a symbolic link (-s
) from the file/directory:
<basebuild>/IpDome-kernel/kernel
to your new link
/home/build/sandbox/gen2/basebuild/IpDome-kernel/kernal
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 type man ln
and you ll get the same information. The man page clearly states:
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
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 /file/that/exists /location/for/new/file
mv /file/that/exists /location/its/moving/to
ln /file/that/exists /the/new/link
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:
commandsfx() {
echo "Symlink: ln -s /path/to/file /path/to/symlink"
echo "Copy: cp /file/to/copy /destination/to/send/copy"
}
alias cmds =commandsfx
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:
makesymlink() {
echo "Symlink name:"
read sym
echo "File to link to:"
read fil
ln -s $fil $sym
}
alias symlink =makesymlink
* - 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