Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use shell script to find out the empty pages and 404 error pages of a website

Shulou Source: shulou.com Published: 2022-06-03 09:18:33 11月12日 Update

This article introduces the knowledge of "how to use shell script to find out the empty pages and error pages of the website". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The code is as follows:

Time cat sitemap.txt | while read line;do curl-l $line-m 5-connect-timeout 5-o / dev/null-s-w "$line"% {http_code} "% {size_download}"\ n "; done

I added a time to see how long it takes to execute the code.

% {http_code} means to return the HTTP status code, from which we can know whether the link is a normal 20000 link or a 404error link.

% {size_download} means to return the size of the current page. If the value is too small, it means that these pages are likely to be low-quality empty pages, and you have to find a way to eliminate them.

This is the end of the content of "how to use the shell script to find out the empty pages and 404 error pages of the site". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Pages websites errors links scripts code content meaning more status knowledge practicality achievement next method dilemma size reality situation article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei MySQL vpn Xiaomi