• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

curl command to check the http status

March 5, 2013 by Sharad Chhetri Leave a Comment

In this post we will read about curl command to check the http status. cURL is a computer software project providing a library and command-line tool for transferring data using various protocols. The cURL project produces two products, libcurl and cURL.
libcurl is a free client-side URL transfer library, supporting FTP, FTPS, Gopher, HTTP, HTTPS, SCP, SFTP, TFTP, Telnet, DICT, the file URI scheme, LDAP, LDAPS, IMAP, POP3, SMTP and RTSP.

curl is a command line tool for getting or sending files using URL syntax.

curl is widely used for checking the staus of URL.
Because it is in command line it is very helpful to system admins and programmer.

I will show you two simple method to check the status of URL.

(1) This is simple method but it shows you the content of URL as well.

 curl https://sharadchhetri.com 

(2) : To only check the status of URL with its header information.

curl -Is https://sharadchhetri.com 

Here, -I = Fetch the HTTP-header only
-s = Silent or quiet mode. Don’t show progress meter or error messages. Makes Curl mute.

Note: With the help of the second method you can create a nagios plugin which do not need to install in client server.

Tips :

sharad@localhost:/tmp$ curl -Is https://sharadchhetri.com | grep HTTP | cut -d ' ' -f2
200
sharad@localhost:/tmp$

Here 200 status mean website is running fine 

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. Nagios HTTP WARNING: HTTP/1.1 403 Forbidden
  2. error command ‘gcc’ failed with exit status 1 in Ubuntu
  3. Find exit status code of last executed command on Linux and Unix
  4. Virtual Machine inaccessible status on VirtualBox 4.3
  5. Set group password,its use and check which group after newgrp command in linux
  6. 6 df Command Examples To Check Mounted Filesystem On Linux
  7. How to install own git server with ssh and http access by using gitolite and gitweb in CentOS
  8. HTTP Client raised and unhandled exception
  9. 4 different commands to check the load average in linux
  10. check_openerp nagios plugin for openerp service check

Filed Under: Linux, Tips And Tricks Tagged With: curl

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

safest method to remove softlink in linux

Replace keyword with its filename without extension : bash script

Password prompt in single user mode is not secure : CentOS/Red Hat

How to put slider shortcode only in home page in WordPress

convert space into new line using sed command

Convert new line to space by using sed command

postgres database backup script using database user password inside

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy