ln: 无法创建符号链接_Linux ln命令教程,并提供创建符号链接的示例

ln: 无法创建符号链接_Linux ln命令教程,并提供创建符号链接的示例_第1张图片

ln: 无法创建符号链接

Linux file systems provides different mechanism to make system administrators and applications developer’s life easier. Symbolic links are one of the mechanism. Symbolic links provides the flexibility to use single file in multiple places with multiple names. But at the end there is only single file and data which is pointed by all of these symbolic links.

Linux文件系统提供了不同的机制,使系统管理员和应用程序开发人员的生活更加轻松。 符号链接是机制之一。 使用符号链接可以灵活地在多个位置使用多个名称的单个文件。 但是最后,所有这些符号链接都指向单个文件和数据。

什么是符号链接 (What is Symbolic Link)

For example we have a file name myprogram which is located in /usr/bin and we need the same app with different name located at /home/poftut/erp . /home/poftut/erp will contain a symbolic link to the myprogram .

例如,我们在/usr/bin有一个文件名myprogram ,我们需要在/home/poftut/erp使用相同名称的同一个应用程序。 /home/poftut/erp将包含指向myprogram的符号链接。

创建软符号链接 (Create Soft Symbolic Link)

Soft symbolic link only provide shortcut for the source file. If we remove the soft symbolic link the source file will not be removed. We can create a soft link with -s option.

软符号链接仅提供源文件的快捷方式。 如果我们删除软符号链接,则不会删除源文件。 我们可以使用-s选项创建一个软链接。

In this example we create soft link for linux echo command with a new name myecho in the /home/ismail/ path.

在此示例中,我们在/home/ismail/路径中使用新名称myecho为linux echo命令创建软链接。

$ ln -s /bin/echo /home/ismail/myecho

你可能感兴趣的:(linux,python,java,css,hadoop)