Skip to content

Instantly share code, notes, and snippets.

@Bonno
Bonno / http-status-check.sh
Created February 5, 2015 14:08
Check list of domains for their http status codes
#!/bin/bash
while read LINE; do
curl -o /dev/null --silent --head --write-out '%{http_code}' "$LINE"
echo " $LINE"
done < url-list.txt
@Bonno
Bonno / webserver-response-curl
Last active February 5, 2018 10:44
View webserver response headers
curl -sSL -o /dev/null -D - http://domain.com
-S, --show-error Show an error message if it fails
-L/--location If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response
code), this option will make curl redo the request on the new place.
-o, --output FILE Write output to <file> instead of stdout
-D, --dump-header FILE Write the headers to this file
curl -v -o - -D - http://domain.com
wget www.whatever.com/folder/{1..30}.html
@Bonno
Bonno / rename
Last active August 29, 2015 14:03
Rename files from commandline
/bin/ls * | awk '{ printf("mv "$0" ")} {gsub(/_/,"."); print $0 }' | bash