Kurly is a free open source, simple but effective, cross-platform alternative to the popular curl command-line tool. It is written in Go programming language and works in the same way as curl but only aims to offer common usage options and procedures, with emphasis on the HTTP(S) operations.

 

Requirements:

GoLang (Go Programming Language) 1.7.4 or higher.

 

How to Install Kurly (Curl Alternative) in Linux

 

Once you have installed Golang on your Linux machine, you can proceed to install kurly by cloning its git repository as shown.

$ go get github.com/davidjpeacock/kurly

 

Alternatively, you can install it via snapd – a package manager for snaps, on a number of Linux distributions. To use snapd, you need to install it on your system as shown.

$ sudo apt update && sudo apt install snapd [On Debian/Ubuntu]
$ sudo dnf update && sudo dnf install snapd     [On Fedora 22+]

 

Then install kurly snap using the following command.

$ sudo snap install kurly

 

On Arch Linux, you can install from AUR, as follows.

$ sudo pacaur -S kurly
OR
$ sudo yaourt -S kurly

 

On CentOS/RHEL, you can download and install its RPM package using package manager as shown.

# wget -c https://github.com/davidjpeacock/kurly/releases/download/v1.2.1/kurly-1.2.1-0.x86_64.rpm
# yum install kurly-1.2.1-0.x86_64.rpm

 

How to Use Kurly (Curl Alternative) in Linux

 

Kurly focuses on the HTTP(S) realm, we will use Httpbin, a HTTP request and response service to partly demonstrate how kurly operates.

 

The following command will return the user agent, as defined in the http://www.httpbin.org/user-agent endpoint.

$ kurly http://httpbin.org/user-agent

 

Next, you can use kurly to download a file (for example Tomb-2.5.tar.gz encryption tool source code), preserving remote filename while saving output using -O flag.

$ kurly -O https://files.dyne.org/tomb/Tomb-2.5.tar.gz

 

To preserve remote timestamp and follow 3xx redirects, use the -R and -L flags respectively, as follows.

$ kurly -R -O -L https://files.dyne.org/tomb/Tomb-2.5.tar.gz

 

You can set a new name for the downloaded file, using the -o flag as shown.

$ kurly -R -o tomb.tar.gz -L https://files.dyne.org/tomb/Tomb-2.5.tar.gz 

 

This example shows how to upload a file, where the -T flag is used to specify the location of a file to upload. Under the http://httpbin.org/put endpoint, this command will return the PUT data.

$ kurly -T ~/Pictures/kali.jpg https://httpbin.org/put

 

To view headers only from a URL use the -I or --head flag.

$ kurly -I https://google.com

 

To run it quietly, use the -s switch, this way, kurly will not produce any output.

$ kurly -s -R -O -L https://files.dyne.org/tomb/Tomb-2.5.tar.gz

 

Last but not least, you can set the maximum time to wait for an operation to complete in seconds, with the -m flag.

$ kurly -s -m 20 -R -O -L https://files.dyne.org/tomb/Tomb-2.5.tar.gz

 

To get a list of all kurly usage flags, consult its command-line help message.

$ kurly -h

 

Cette réponse était-elle pertinente? 0 Utilisateurs l'ont trouvée utile (0 Votes)