This is the Cs version of the script posted by michaelkrieger at jellyfin/jellyfin#1907 (comment) to cleanup the collection.xml for missing link entires.
To run this on linus, ensure you have a dotnet version installed.
https://learn.microsoft.com/en-us/dotnet/core/install/linux
or for the most part, this oneliner will install dotnet on your system: