I want to remove all the symbolic links of files. I have a directory structure like /usr/local/instantclient/11.2.0.3
which contains lots of files and i have symbolic links of these files in /usr/local/lib/
Now i want to delete all these symbolic links of those files. How can i do this in one command. If i remove the actual dir /usr/local/instantclient/11.2.0.3
containing files then it will leave the broken links in /usr/local/lib
.
Linux – Remove all symbolic links of files in one command
bashlinux
Best Answer
To remove the links (from
man find
under-type
):I think this should do the trick:
Does the output produce a list of the files you want to delete? If so, when you are 100% sure:
This will remove only broken links. To delete all links, remove the
-follow
stanza, but I wouldn't do that under/usr/local/lib
.