On my computer there are about 900 redundant internet folders with the extension
"_files". In addition there are the corresponding .htm or .html files. These files
are not within the folders having the extension "_files". They are within the
same directories as the folders having the extension "_files"
The redundant folders are all over the place, in various directories. And now is the
time to get rid of them. And the associated htm and html files.
What would be the best way to carry out the purge with a few command-line
I only know how to find the folders:
$ find ~ -name \*\\_files\* > folders.txt
produces a text list of the redundant folders I have.
But then what I would like to do is to
- take the name of each folder without its _files extension
- delete the corresponding .htm or .html file
- delete the folder
- and move on recursively to other directories
So how can I capture the name of each folder and use it to
delete first the similarly named htm/html file and then
to delete the folder itself?
Please can you help me? 900+ thanks if you can.