Skip to content

Instantly share code, notes, and snippets.

@youshy
Last active October 5, 2020 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save youshy/ce167b50c119c3df0655d0b650ad0eaa to your computer and use it in GitHub Desktop.
Save youshy/ce167b50c119c3df0655d0b650ad0eaa to your computer and use it in GitHub Desktop.
Curl & SSH

Curl

Postman

High-level - way to transfer data within terminal. We'll focus on HTTP functionality:

GET - literally get something POST - post something (save) PUT - update something DELETE - delete something

GET

curl <hostname>

POST

-X changes the method, by default it's GET

curl -X POST -d <data> <hostname>

PUT

curl -X PUT -d <data> <hostname>

DELETE

curl -X DELETE <hostname>

MAKE IT SILENT

-s or --silent

or if you really don't like data:

curl <something> > /dev/null

SSH

In case you need to log into remote machine, you can do that using SSH.

SSH stands for secure shell. Provides a secure channel over an unsecured network. Best way to think about it? Anytime you need to log into a server, use SSH.

Usage

ssh <username>@<hostname>

Extras:

  • -p <port> - specify port on which the connection should be estabilished
  • -i <file/credentials> - specify the credentials to auth over the server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment