Most Linux commands that access the Internet look in the
SOCKS_SERVER environment variables for proxy information. So, to do something like your example, just run:
The syntax for
FTP_PROXY is slightly different:
The default GNOME desktop environment included with Ubuntu's proxy settings has an Apply System-Wide button, which will automatically set those environment variables for you. Otherwise, you can add the
export lines to your
~/.bashrc file to make them take effect at every login.
wget doesn't support SOCKS at all. You can use
curl, which is included with Ubuntu, to achieve many things that
wget does. Unfortunately, it doesn't check
SOCKS_SERVER, while it does check
HTTP_PROXY (as does
wget). To use curl to download this page with a SOCKS5 server (performing DNS resolution with that server) and save it as
superuser.html, run this:
curl --socks5-hostname 22.214.171.124:8000 http://superuser.com/q/262956/66003 > superuser.html
If you want to make
curl always use that SOCKS proxy, you could create a shell alias. Just add the following line to your
alias curl='curl --socks5-hostname 126.96.36.199:8000'
You will need to restart your terminal or run that line as if it were a command for the changes to take effect.