How can I break a symbolic link loop?

Evan Kroske

While I was trying to compile a C shared object library, I accidentally created two symbolic links which point to each other. Is there a way to get rid of them without nuking the whole directory? I read that the only way to break a symbolic link is to delete the file it points to, but I'm sure there must be another way. Thanks for the help.

Mark Borgerding

It's not a problem to delete symbolic links. I'm not sure why you think that you need to delete the file the link points to.

Just delete them. Try this:

ln -s thing1 thing2   # thing1 does not exist
ln -s thing2 thing1   # circular reference
rm thing1 thing2      # no problem

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Can I replace a program folder with a symbolic link to another drive?

분류에서Dev

How to properly create symbolic link?

분류에서Dev

How to create symbolic link when I insert a X10 firecracker USB device

분류에서Dev

How do I perform variable assignment with a loop, and break?

분류에서Dev

Can GNU Stow use a stow directory that is a symbolic link?

분류에서Dev

How to get full path of original file of a soft symbolic link?

분류에서Dev

failed to create symbolic link

분류에서Dev

Disk usage of a symbolic link

분류에서Dev

Change permissions for a symbolic link

분류에서Dev

Disk usage of a symbolic link

분류에서Dev

Failed to create a symbolic link

분류에서Dev

How can I iterate through a function with for loop?

분류에서Dev

How can I resolve this loop in c#?

분류에서Dev

How to break a for loop from inside an if statement in Julia?

분류에서Dev

How to break a bash loop by output of an internal script?

분류에서Dev

How can I transform an html button link to a pandas dataframe?

분류에서Dev

How can I get some particular link form the links collection

분류에서Dev

How can I link libm to my emscripten port

분류에서Dev

How can I implement a OneToMany association with a separate link table?

분류에서Dev

How can I link to a web page of another folder?

분류에서Dev

how can I get this a tag to go to the link exluding the following code

분류에서Dev

Executable symbolic link file not working

분류에서Dev

symbolic link to a directory and relative path

분류에서Dev

Using symbolic link in Windows XP

분류에서Dev

Why is /etc/localtime a symbolic link?

분류에서Dev

Create Symbolic Link as Regular user

분류에서Dev

How can I pause a loop until I get a users input?

분류에서Dev

how can i loop for store items i want in ExtJS XTemplate?

분류에서Dev

Why do I temporarily get 'Input/output error' reading a symbolic link in a NFS mount?

Related 관련 기사

  1. 1

    Can I replace a program folder with a symbolic link to another drive?

  2. 2

    How to properly create symbolic link?

  3. 3

    How to create symbolic link when I insert a X10 firecracker USB device

  4. 4

    How do I perform variable assignment with a loop, and break?

  5. 5

    Can GNU Stow use a stow directory that is a symbolic link?

  6. 6

    How to get full path of original file of a soft symbolic link?

  7. 7

    failed to create symbolic link

  8. 8

    Disk usage of a symbolic link

  9. 9

    Change permissions for a symbolic link

  10. 10

    Disk usage of a symbolic link

  11. 11

    Failed to create a symbolic link

  12. 12

    How can I iterate through a function with for loop?

  13. 13

    How can I resolve this loop in c#?

  14. 14

    How to break a for loop from inside an if statement in Julia?

  15. 15

    How to break a bash loop by output of an internal script?

  16. 16

    How can I transform an html button link to a pandas dataframe?

  17. 17

    How can I get some particular link form the links collection

  18. 18

    How can I link libm to my emscripten port

  19. 19

    How can I implement a OneToMany association with a separate link table?

  20. 20

    How can I link to a web page of another folder?

  21. 21

    how can I get this a tag to go to the link exluding the following code

  22. 22

    Executable symbolic link file not working

  23. 23

    symbolic link to a directory and relative path

  24. 24

    Using symbolic link in Windows XP

  25. 25

    Why is /etc/localtime a symbolic link?

  26. 26

    Create Symbolic Link as Regular user

  27. 27

    How can I pause a loop until I get a users input?

  28. 28

    how can i loop for store items i want in ExtJS XTemplate?

  29. 29

    Why do I temporarily get 'Input/output error' reading a symbolic link in a NFS mount?

뜨겁다태그

보관