0

Whenever I attempt to cd my Downloads folder to run a C# program that I have written, I keep getting this message. When I try moving the file to snap and/or socket (the only two which are responding to the cd command), it does not appear there. How do I fix the issue with "too many levels of symbolic links"?

enter image description here

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:~#
4
  • 2
    ls -l Downloads might help show what is going on
    – thrig
    Commented Sep 10, 2022 at 2:25
  • Please don't post images of text. Copy and paste the text itself into your question and format it as code by selecting it and pressing Ctrl-K or by using the editor's {} icon.
    – cas
    Commented Sep 10, 2022 at 3:09
  • @cas, very true, though here the colours give us an additional clue that all symlinks are broken, not just Downloads. Commented Sep 10, 2022 at 8:38
  • Don't login as root, the root account is only to perform privilege administrative tasks. The root user having things like personal Downloads, Music, Videos directory is an aberration. Commented Sep 10, 2022 at 8:40

1 Answer 1

1

Downloads is probably a symlink to itself. Or to another symlink that points back to Downloads, or a longer chain of symlinks that also results in an effectively infinite chain of symlinks pointing to each other. e.g.

$ 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

The solution is "Don't do that". Either delete the Downloads symlink or re-create it to point to somewhere that exists.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .