Too many levels of symbolic links

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
markmc

Too many levels of symbolic links

Post by markmc »

I merged two directories in MATE that had the same name. The directory now shows up in Caja as a file with 'link (broken)' as the type.
Oops.

If I try to cd in the terminal I get...
bash: cd: get_iplayer: Too many levels of symbolic links

Any ideas how to get back into this directory?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
lmuserx4849

Re: Too many levels of symbolic links

Post by lmuserx4849 »

markmc wrote: Mon May 21, 2018 11:22 pm I merged two directories in MATE that had the same name. The directory now shows up in Caja as a file with 'link (broken)' as the type.
Oops.

If I try to cd in the terminal I get...
bash: cd: get_iplayer: Too many levels of symbolic links

Any ideas how to get back into this directory?
There is some sort of symbolic link recursion.

Is get_iplayer a symbolic link, see output from ls -l get_iplayer

It'll look something like this (notice "l" at the beginning and the arrow): lrwxrwxrwx ... test2/src/test2 -> ./test2
The above symbolic link example, will produce the same error you are receiving.
If symlink was absolute, rather than relative it would have been okay.
By relative I mean, dot (./), which is the current directory. dot-dot (../) is the parent directory or go up one directory.
Absolute is the fully-qualified name: $HOME/test/test2/.

Go one directory up from get_iplayer and do: tree --noreport -fp
You might have to install the tree package.

iget_player I'm guessing is a symlink that is pointing to its' self.
The real directory is going to be on the left-hand side of the arrow (see above).
If you don't need the symlink remove (rm) it. Or you can make it absolute (ln -s) or change as necessary.

How did you do your "merge", Caja or cp or mv on the terminal?

I don't use Caja much, but when I right click I see: Make Link, Rename..., Copy to +, Move to +.

Commands:
Locked

Return to “Scripts & Bash”