How To Create a Symbolic Link on Ubuntu

作者:Rui 发布时间:October 29, 2015 分类:Linux,CLOUD 浏览:406

The syntax of ln command is:

ln [options] <target file> [link name]

So, this command should work:

ln -sv /media/fileserver/anotherfile.ods /home/user/anotherfile.ods

The s option creates a symbolic link, if omitted a hard link will be created. v means "be verbose", i.e. ln will show what it's doing.

You could also cd to target's directory first:

cd /media/fileserver
ln -sv anotherfile.ods /home/user/anotherfile.ods

Or cd to destination directory:

cd /home/user/
ln -sv /media/fileserver/anotherfile.ods

If you omit the link name, target's name is used. The above command creates a link to /media/fileserver/anotherfile.ods in /home/user/anotherfile.ods.

标签: linux, ubuntu

添加新评论 »