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

Checking Whether a URL Exists from the Command Line

https://kenzo0107.github.io/en/2015/06/16/check-whether-the-url-exists/

Author

Kenzo Tanaka

Posted on

2015-06-16

Licensed under