Awful thing about curl is, it exits with 0 when it gets HTTP error responses. Workaround for this is to use these switches: -O or '-o filename' To send regular output away -s (No -v) If don't want regular output along with the code. -w '\n%{http_code}\n' To write the response HTTP code. Skip first \n, for delimiting, if -s. curl -O http://... # works just like "wget url". I.e. writes to file # with name based on the downloaded file curl http://.. # writes to stdout curl -L ... # Follow redirects curl -k https://.. # Doesn't enforce cert check curl -x proxy.server:80 [-U username:password] curl -o filename http:// # is just like "wget -O filename url" "-C -" "resumes" a fetch. I think can resume from any aborted fetch. curl -u username[:password] # Basic Auth curl -F name=val... Post a value val from file: 'name=