Given an html file, something like myfile.html, and a folder with some files in it that are part of the web-page and others that are not linked in the html.How can you delete the files that are not linked?
Delete files that are not linked from an html file
bash
If we accept that we'll count as linked anything whose name shows up as a string in the file (which may not strictly be a link, but makes things a bit easier in my head at least):for candidate in folder/*; do    if ! grep -q $candidate myfile.html; then        rm $candidate    fidone