Is there any shortcut/easy way to switch this system proxy settings? Sometimes I need to send my traffic to a proxy, sometimes I don't.

Currently, I have to go to the settings every time to click it.

Is there any simple way for me to switch this? For instance, use a shell command to do this.
This can be done with networksetup.

Get all services:

networksetup -listallnetworkservices


Then with the proper service (e.g Ethernet or the name of your USB 10/100/1000 LAN adapter) enter

sudo networksetup -setsocksfirewallproxy &lt;networkservice&gt; &lt;domain&gt; &lt;port number&gt; &lt;authenticated&gt; &lt;username&gt; &lt;password&gt;


or

sudo networksetup -setwebproxy &lt;networkservice&gt; &lt;domain&gt; &lt;port number&gt; &lt;authenticated&gt; &lt;username&gt; &lt;password&gt;


to configure it (which isn't necessary in your case, because you already entered all necessary values).

e.g.

sudo networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 18080
sudo networksetup -setwebproxy Ethernet 127.0.0.1 18080


To simply toggle it on or off use: 

sudo networksetup -setsocksfirewallproxystate networkservice on | off
sudo networksetup -setwebproxystate networkservice on | off


e.g. 

sudo networksetup -setsocksfirewallproxystate Ethernet off
sudo networksetup -setwebproxystate Ethernet off


man networksetup will reveal other proxy options (gopher, ftp, etc.)