Many applications do not directly support the use of socks proxy. Torsocks enables such applications to use the tor socks proxy.
Torsocks gets installed along with the tor package on ubuntu for example
$ sudo apt-get install tor
Lets say we want to proxify the telnet command to connect through a proxy. This can be done by wrapping the telnet command with torify/usewithtor.
$ torify telnet google.com 80
$ usewithtor telnet google.com 80
Now all network calls made by the telnet programs shall be routed through the tor proxy. To see the proxy effect try opening the the url www.ipmango.com/api/myip through curl. The url echos the public ip of the requesting user.
Without proxy it would look something like this
$ curl www.ipmango.com/api/myip 22.214.171.124 $
Now using it with torsocks.
$ usewithtor curl www.ipmango.com/api/myip 126.96.36.199 $
Now the ip is changed because the url was opened through the tor proxy.
Check the project homepage to find out what applications work well with torsocks. For example pidgin works with torsocks. Just launch it with the usewithtor command
$ usewithtor pidgin