Linux Commands Examples

A great documentation place for Linux commands


Shell wrapper to simplify the use of the torsocks(8) library to transparently allow an application to use a SOCKS proxy. Basically a renamed, patched tsocks.


torsocks [application [application’s arguments]]
or torsocks [on|off]
or torsocks

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


no example yet ...

... Feel free to add your own example above to help other Linux-lovers !


torsocks is a wrapper between the torsocks library and the application what you would like to run socksified.


[application [application’s arguments]]

run the application as specified with the environment (LD_PRELOAD) set such that torsocks(8) will transparently proxy SOCKS connections in that program


this option adds or removes torsocks(8) from the LD_PRELOAD environment variable. When torsocks(8) is in this variable all executed applications are automatically socksified. If you want to use this function, you HAVE to source the shell script from yours, like this: "source /usr/bin/torsocks" or ". /usr/bin/torsocks"
". torsocks on" -- add the torsocks lib to LD_PRELOAD
". torsocks off" -- remove the torsocks lib from LD_PRELOAD


show the current value of the LD_PRELOAD variable

<without any argument>

create a new shell with LD_PRELOAD including torsocks(8).


By default, torsocks will assume that it should connect to the SOCKS proxy running at on port 9050. This is the default address and port for Tor’s socks server on most installations.

In order to use a configuration file, you must set the environment variable TORSOCKS_CONF_FILE with the location of the file.

If TORSOCKS_CONF_FILE is not set, torsocks will attempt to read the configuration file at /etc/torsocks.conf. If that file cannot be read, torsocks will use sensible defaults for most Tor installations, i.e. it will assume that you want to use a SOCKS proxy running at (localhost) on port 9050.

For further information on configuration, see torsocks.conf(5).


This script was created by Tamas SZERB <toma[:at:]rulez[:dot:]org> for the debian package of tsocks. It (along with this manual page) have since been adapted into the torsocks project and modified.

How can this site be more helpful to YOU ?

give  feedback