broken-link-checker icon indicating copy to clipboard operation
broken-link-checker copied to clipboard

[Feature] Only List Broken Links

Open ncorder opened this issue 3 years ago • 3 comments

Feature: Have an option to only list broken links

Currently, it appears the command will list all links and which ones are broken and which are ok

When searching very large websites, it can be difficult to see which ones are broken.

ncorder avatar Nov 21 '21 04:11 ncorder

As a bit of a workaround (assuming you don't have the name BROKEN in any of your file names, you could just grep for them like so:

blc website -ro | grep BROKEN | tee broken.txt

The tee command writes them to a file called broken.txt and also displays them to stdout.

If you do have file names that don't match, you could probably come up with some more sophisticated regex.

davisdude avatar Dec 14 '21 17:12 davisdude

@davisdude thanks for the suggestion, but I'm afraid in our case that doesn't help either as I also need to know on which page the broken link can be found :)

KANEI avatar Jan 25 '22 16:01 KANEI

I agree this enhancement would be helpful. In the meantime this is my workaround: blc $WEBSITE -ro 2>&1|grep -iEB1 "[^0].broken"

dominicraf avatar Dec 15 '22 07:12 dominicraf