Author: Sahil Suri

18 curl command examples in Linux/Unix

What is curl command? The curl command is a powerful command line tool used to transfer data to or from a server. It can use any one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE) for data transfer. In many aspects curl is similar to the wget command but curl is more feature rich as compared to wget. The cURL stands for “See URL“. The curl command is generally available by default on UNIX systems. Let’s verify that we have curl installed. [root@linuxnix ~]# which curl /usr/bin/curl [root@linuxnix ~]# rpm -qf /usr/bin/curl curl-7.19.7-52.el6.x86_64 In case your system does not have curl installed then you can install it manually. If you are using a RedHat based system then type: yum install curl If you are using a Debian based system then type: apt-get install curl In this article, we’ll go through some examples to understand some of the features curl provides. Example 1: Save a web page. [root@linuxnix ~]# curl https://www.linuxnix.com/ >> linuxnix.html % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 206k 0 206k 0 0 29952 0 --:--:-- 0:00:07 --:--:-- 179k [root@linuxnix ~]# The above example will save the content of the web page https://www.linuxnix.com/ to a file named linuxnix.html. Example 2: Specify output file name in curl command By...

Read More

7 mpstat command examples in linux

The ability to accurately measure CPU usage of a system is essential to ensure optimal operation of the applications or databases running on that system. The mpstat Linux command is a utility that collects and displays information about CPU utilization and performance statistics. To view which processes on the system are using more CPU resources, use the Linux top command. The mpstat binary is part of the sysstat package which also provides the sar command utility. Use Linux which command to see if mpstat command is available or not. [sahil@linuxnix:~] $ which mpstat /usr/bin/mpstat [sahil@linuxnix:~] $ rpm -qf /usr/bin/mpstat sysstat-9.0.4-33.el6.x86_64 Use mpstat -V command to view the version of mpstat installed on your system. [sahil@linuxnix:~] $ mpstat -V sysstat version 9.0.4 (C) Sebastien Godard (sysstat <at> orange.fr) We’ll now go over some examples to help us understand how to use the mpstat command in Linux. Example 1: Executing the mpstat command without any options. Like most utilities provided by sysstat, mpstat has some options that can be used with the command. When the mpstat command is run without any option we see the below output: [sahil@linuxnix:~] $ mpstat Linux 2.6.32-696.6.3.el6.x86_64 (linuxnix.com) 10/28/2017 _x86_64_ (6 CPU) 09:14:38 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle 09:14:38 AM all 29.39 0.00 1.66 12.04 0.00 0.12 0.00 0.00 56.79 In case you get a “command not found error“, then your system is probably missing...

Read More

How to integrating Prometheus with Grafana in Linux

In an earlier article, we demonstrated the installation and setup of Prometheus, a lightweight, and user-friendly open source monitoring tool. In this article, we will show you how to integrate data collected by Prometheus with Grafana to create beautiful dashboards. Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus, and InfluxDB. Before proceeding with the installation let us go over some of its features: Features of Grafana Grafana provides a wide variety of visualization options to help you understand your data. These data visualization offerings include heatmaps, histograms, graphs, geomaps etc. You can use grafana to define alert thresholds visually and get notified via Slack, PagerDuty or other tools in case a threshold breaches. It allows you to import data from multiple sources and visualize the data centrally through grafana. Grafana has numerous plugins available thereby giving users immense scope for customization. Dashboards created using grafana can be shared among teams promoting more collaboration. Grafana can seamlessly integrate with an organization’s existing authentication mechanism. Grafana supports multi-tenancy. Setup multiple organizations that each can have their own admins define their own data sources, dashboards and users. Grafana includes power user preferences including the option to select from dark or white themes, set your home dashboard, change timezones and more. With a basic understanding of what grafana is and it’s important features, we’ll...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.