There's a plugin for that: https://github.com/ccrisan/xfce4-netspeed-plugin
For a command, it's kind of complicated because you only have totals, there's no built-in instantanous network speed. The network speed in an single instant is always either zero or full bore: either data is being transmitted/received or it isn't. You need to average over time with multiple samples. So if you want bits per second, such a command would need to at least take a sample, wait a second, take another sample, substract the two, then return the result. Ideally you want to sample over a few seconds otherwise it'll still be pretty much all over the place. So the panel plugin is a better idea for that, as it'll do the math and averaging for you.