stevenvachon / broken-link-checker

Find broken links, missing images, etc within your HTML.
MIT License
1.97k stars 305 forks source link

[Feature] Only List Broken Links #242

Open ncorder opened 3 years ago

ncorder commented 3 years ago

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.

davisdude commented 2 years ago

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.

marekvantuch commented 2 years ago

@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 :)

dominicraf commented 1 year ago

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