Catalogue
Checking Whether a URL Exists from the Command Line

Checking Whether a URL Exists from the Command Line

🌐 日本語で読む

Run the following command from a terminal on your local Mac:

1
curl -v <URL>  2>&1 1>/dev/null | awk '{if($2~"HTTP") print}'

OK Pattern.

1
< HTTP/1.1 200 OK

NG Pattern

1
< HTTP/1.1 404 Not Found
kenzo0107

kenzo0107