Symbolic links provides practical solutions file name or path related problems. Symbolic links will create same file or folder with different name and path. In some situations this may cause problem and we have to remove and delete symbolic link.
符号链接提供了实用的解决方案,文件名或路径相关的问题。 符号链接将使用不同的名称和路径创建相同的文件或文件夹。 在某些情况下,这可能会导致问题,我们必须删除和删除符号链接。
列出符号链接 (List Symbolic Links)
We can start by listing existing links especially symbolic links with ls
command like below. Symbolic links provide some redirect to the source file like symbolic link RealInput
.
我们可以通过如下所示的ls
命令首先列出现有链接,尤其是符号链接。 符号链接提供了一些到源文件的重定向,例如符号链接RealInput
。
$ ls -lh
List Symbolic Links
列出符号链接
删除符号链接(Remove Symbolic Links)
There are different ways to remove symbolic link. We can just issue rm
command to the link file. In this example we will remote link named RealInput
.
有多种方法可以删除符号链接。 我们可以向链接文件发出rm
命令。 在此示例中,我们将名为RealInput
远程链接。
$ rm RealInput
使用unlink命令删除 (Remove with unlink Command)
As we use ln
command which is shortcut for link we have also command named unlink
which can unlink given links. In this example we can remove RealInput
like below. unlink
command is an alias for rm
command.
当我们使用ln
命令(它是链接的快捷方式)时,我们还使用了名为unlink
命令,该命令可以取消链接给定的链接。 在此示例中,我们可以删除RealInput
如下所示。 unlink
命令是rm
命令的别名。
$ unlink RealInput
使用sudo删除符号链接以解决“权限被拒绝”错误 (Remove Symbolic Links with sudo for “Permission Denied” Error)
Some symbolic links may be created by privileged user like root
. If we try to remove this links with regular or less privileged user we will get an error like permission denied
. So in order to remove this symbolic links we need to provide sudo
command at the beginning of the command like below.
一些符号链接可能由root
用户等特权用户创建。 如果我们尝试删除普通用户或特权较少的用户的此链接,则会收到类似permission denied
的错误。 因此,为了删除此符号链接,我们需要在命令的开头提供sudo
命令,如下所示。
$ sudo rm RealInput
删除硬链接 (Remove Hard Links)
We can easily remove hard links with the same commands too.
我们也可以使用相同的命令轻松删除硬链接。
$ unlink RealInput
OR
要么
$ rm RealInput
.uadf5b8db2f8636950ca1052038ff38fa , .uadf5b8db2f8636950ca1052038ff38fa .postImageUrl , .uadf5b8db2f8636950ca1052038ff38fa .centered-text-area { min-height: 80px; position: relative; } .uadf5b8db2f8636950ca1052038ff38fa , .uadf5b8db2f8636950ca1052038ff38fa:hover , .uadf5b8db2f8636950ca1052038ff38fa:visited , .uadf5b8db2f8636950ca1052038ff38fa:active { border:0!important; } .uadf5b8db2f8636950ca1052038ff38fa .clearfix:after { content: ""; display: table; clear: both; } .uadf5b8db2f8636950ca1052038ff38fa { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .uadf5b8db2f8636950ca1052038ff38fa:active , .uadf5b8db2f8636950ca1052038ff38fa:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .uadf5b8db2f8636950ca1052038ff38fa .centered-text-area { width: 100%; position: relative; } .uadf5b8db2f8636950ca1052038ff38fa .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .uadf5b8db2f8636950ca1052038ff38fa .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .uadf5b8db2f8636950ca1052038ff38fa .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .uadf5b8db2f8636950ca1052038ff38fa:hover .ctaButton { background-color: #E67E22!important; } .uadf5b8db2f8636950ca1052038ff38fa .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .uadf5b8db2f8636950ca1052038ff38fa .uadf5b8db2f8636950ca1052038ff38fa-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .uadf5b8db2f8636950ca1052038ff38fa:after { content: ""; display: block; clear: both; }
LEARN MORE What Does "rm -rf" Command Do In Linux?
.uadf5b8db2f8636950ca1052038ff38fa , .uadf5b8db2f8636950ca1052038ff38fa .postImageUrl , .uadf5b8db2f8636950ca1052038ff38fa .centered-text-area { min-height: 80px; position: relative; } .uadf5b8db2f8636950ca1052038ff38fa , .uadf5b8db2f8636950ca1052038ff38fa:hover , .uadf5b8db2f8636950ca1052038ff38fa:visited , .uadf5b8db2f8636950ca1052038ff38fa:active { border:0!important; } .uadf5b8db2f8636950ca1052038ff38fa .clearfix:after { content: ""; display: table; clear: both; } .uadf5b8db2f8636950ca1052038ff38fa { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .uadf5b8db2f8636950ca1052038ff38fa:active , .uadf5b8db2f8636950ca1052038ff38fa:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .uadf5b8db2f8636950ca1052038ff38fa .centered-text-area { width: 100%; position: relative; } .uadf5b8db2f8636950ca1052038ff38fa .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .uadf5b8db2f8636950ca1052038ff38fa .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .uadf5b8db2f8636950ca1052038ff38fa .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .uadf5b8db2f8636950ca1052038ff38fa:hover .ctaButton { background-color: #E67E22!important; } .uadf5b8db2f8636950ca1052038ff38fa .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .uadf5b8db2f8636950ca1052038ff38fa .uadf5b8db2f8636950ca1052038ff38fa-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .uadf5b8db2f8636950ca1052038ff38fa:after { content: ""; display: block; clear: both; }
了解更多信息“ rm -rf”命令在Linux中做什么?
翻译自: https://www.poftut.com/remove-symbolic-links-linux/
linux建立文件的符号链接,如何在Linux中创建符号链接[完整指南]
Linux中的符号链接是什么,为什么使用它? 符号链接(也称为符号链接或软链接)是一种特殊类型的文件,它只是指向另一个文件或目录,就像Windows中的快捷方式一样,创建符号链接就像为实际文件创建别名 ...
linux 命令行删除分区,如何在 Linux 中删除分区
管理分区是一件严肃的事情,尤其是当你不得不删除它们时.我发现自己经常这样做,特别是在使用 U 盘作为实时磁盘和 Linux 安装程序之后,因为它们创建了几个我以后不需要的分区. 在本教程中,我将告诉你 ...
groupdel 删除组_如何在Linux中删除组– groupdel命令
groupdel 删除组 Linux groupdel command is used to delete a group. This is a very powerful command, so u ...
linux 怎么删除大文件,如何在Linux中删除超大的(100-200GB)文件
平日,要在 Linux 终端删除一个文件,我们应用 rm 敕令(删除文件).shred 敕令(安然删除文件).wipe 敕令(安然擦除文件)或者 secure-deletion 对象包(一个安然文件删 ...
rm如何在Linux中删除一个大文件
rm -rf命令是删除文件夹及其内容最快的方式之一. 仅仅一丁点的敲错或无知都可能导致不可恢复的系统崩坏. 下列是一些rm 命令的选项: rm 命令在Linux下通常用来删除文件. rm -r 命令递 ...
删除非空目录linux_如何在Linux中删除空的非空目录
删除非空目录linux Linux file system consist of directories. A system administrator generally work with dir ...
linux删除0字节的文件,如何在linux中删除许多0字节的文件?
I've a directory with many number of 0 byte files in it. I can't even see the files when I use the l ...
linux怎样删目录,删除如何在Linux中删除目录
如何在Linux中删除目弽 有几种方法可以用来删除linux中的目弽.您可以从桌面环境中以图形方式处理它,也可以直接从命令行执行该操作.无论哪种方式都可行,而且它们都同样有效. 在Linux中删除目录 ...
linux中设置环境变量_如何在Linux中设置环境变量
linux中设置环境变量 Wondering how to set environment variables in Linux? This is exactly what we'll be doin ...
linux disk 清除数据,如何在Linux中使用TestDisk恢复已删除的文件
我们都知道寻找文件而不是找到文件的感觉,即使是在垃圾桶里也是如此. 由于TestDisk ,文件和数据丢失带来的创伤应该结束 - 这是一个免费的开源软件,最初设计用于恢复内存分区并使不可引导的磁盘再次 ...