Using an "if" statement with curl in terminal?

Viewed 4331

I'm using this command to get the response code of a page using curl:

curl -s -o /dev/null -w "%{http_code}" 'https://www.example.com'

If the response code is 200, then I want to delete a certain file on my computer. If it isn't 200, nothing should be done.

What's the easiest way to do this?

1 Answers
Related