suse@linux-337q:~/program/lottery> ln -s gainu …/softgainu
suse@linux-337q:~/program/lottery> ln gainu …/yingainu
suse@linux-337q:~/program/lottery> cd …/
suse@linux-337q:~/program> ls -l softgainu
lrwxrwxrwx 1 suse users 5 5 月 22 23:31 softgainu -> gainu
suse@linux-337q:~/program> ls -l yingainu
-rwxr-xr-x 4 suse users 13260 4 月 10 11:28 yingainu
suse@linux-337q:~/program> ./softgainu
bash: ./softgainu: 没有那个文件或目录
suse@linux-337q:~/program>
你必须手动指定完整的路径.
比如
ln -s ~/program/lottery/gainu …/softgainu
应该要使用绝对路径吧,用相对路径不行的。~ 也可以用。