Internet via terminal

terminal-001

Like in previous post I want to write little note about making request and file transfer via terminal on Mac and Linux OS.

Problem 1. Making POST request

There is useful command called wget. It can be used to make quick request to some page with POST values. So, let’s say that you want make request to page http://doszhan.com with POST parameters [“username” => “doszhan”, “password” => “passphrase”]:

wget http://doszhan.com --post-data 'username=doszhan&password=passphrase'

Screen Shot 2017-02-10 at 11.02.18

In case wget is not installed, you can install it on Mac by brew:

brew install wget

Problem 2. Upload/download file to/from server

Uploading file to remote server:

scp [path to local file/filename] user@[server IP address OR domain name]:/[path where to save on remote server]

Screen Shot 2017-02-10 at 11.07.40

Downloading file from remote server:

scp user@[server IP address OR domain name]:/[path to file/filename] [local path where to save]

Screen Shot 2017-02-10 at 11.12.09

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Profile photo of Doszhan Kalibek

Doszhan Kalibek