每当我尝试在cd
我的Downloads
文件夹中运行我编写的 C# 程序时,我都会不断收到此消息。当我尝试将文件移动到快照和/或套接字(唯一响应命令的两个cd
)时,它不会出现在那里。如何解决“符号链接级别过多”的问题?
root@LAPTOP-040SRHIO:~# cd Downloads
-bash: cd: Downloads: Too many levels of symbolic links
root@LAPTOP-040SRHIO:~# ls
Desktop Documents Downloads Music Pictures Public snap socket Templates Videos
root@LAPTOP-040SRHIO:~# cd Downloads
-bash: cd: Downloads: Too many levels of symbolic links
root@LAPTOP-040SRHIO:~#
答案1
Downloads
可能是其自身的符号链接。或者指向另一个指向下载的符号链接,或者更长的符号链接链,这也会导致实际上无限的符号链接链指向彼此。例如
$ ln -s Downloads Downloads
$ ls -lF Downloads
lrwxrwxrwx 1 cas cas 9 Sep 10 13:10 Downloads -> Downloads
$ cd Downloads
-bash: cd: Downloads: Too many levels of symbolic links
解决办法是“不要那样做“。删除下载符号链接或重新创建它以指向存在的某个位置。