How to resolve "Too many levels of symbolic links" on my Documents folder?

126

It was suggested that I run find /home/$username/Documents -type l -exec ls -l {} \; which provided this output: lrwxrwxrwx 1 sonar sonar 18 Nov 21 06:03 /home/$username/Documents -> /home/$username/Documents

Turns out the Documents folder was symlinked to itself. Running unlink Documents completely resolved the issue and allowed me to access my Documents folder again with no issue. Thanks GracefulRestart!

Share:
126
UnityDev
Author by

UnityDev

Updated on September 18, 2022

Comments

  • UnityDev
    UnityDev over 1 year

    I have a WPF application and i am opening a drawing in AutoCAD from my application. I just wanted to restrict user to change current profile using set current button, and i didn't want to make profile changes in registry settings.

    • GracefulRestart
      GracefulRestart over 4 years
      That find command is not producing any good output. Please try running find /home/$username -type l -exec ls -l {} \; and post the result in your question to show all of the symbolic links.
    • SonarMonkey
      SonarMonkey over 4 years
      The output of the command you provided was: lrwxrwxrwx 1 sonar sonar 21 Nov 21 06:03 /home/sonar/Documents -> /home/sonar/Documents (sonar being my username)
    • GracefulRestart
      GracefulRestart over 4 years
      That is a bad symbolic link, as it points to itself. You seem to have no Documents directory.
    • SonarMonkey
      SonarMonkey over 4 years
      Is there any chance it was just somehow linked to itself, and that the symlink could be removed? If not, how do I just get rid of it and create a fresh Documents folder? Removing the directory doesn't work.
    • GracefulRestart
      GracefulRestart over 4 years
      You are not showing what you are trying, just stating "it doesn't work" does not give anyone useful information to attempt to help you. To remove the symbolic link, try unlink /home/sonar/Documents. You should not have been able to create that symbolic link if there was an actual Documents directory there. Did you check that maybe you renamed the Documents directory to something else or maybe put it in a different directory? find / -type d -name *Documents* could help.
  • Pawel Debski
    Pawel Debski almost 4 years
    I wonder how it could had happened. Anyone has an idea?