Quite new to BASH and looking for some tips, as I'm afraid to even start with this.
I have a webpage that lists image downloads, for example
<img src="01.jpg" alt="" width="1920" height="1080" />
<img src="02.jpg" alt="" width="1920" height="1080" />
<img src="03.jpg" alt="" width="1920" height="1080" />
I would like to run BASH to read this web page, its local one, to pick up the file names, i.e. 01.jpg, 02.jpg and 03.jpg, and then delete all the other .jpg files in the directory that do not match. So, for example, if there was 04.jpg in the folder, then this file will be deleted, since it is not on the web page.
Sorry, I didn’t post any encoding, I just didn’t fall on it.
Thank you in advance
source
share