How to set fanspeed in Linux from terminal

I’m not sure where you can enter those values, but it doesn’t work in my terminal.
Depending on why you use the GPU, if you have constant high GPU usage (like heavy gaming, or folding or crunching), the best thing you can do, is lower the TDP of the card.
It’ll still throttle the speed, but the card will run much cooler.

For reference, I have an open test bench, with an environment temperature of somewhere between 60-75F, and I can get 90-95% performance out of any RTX card running them at the following settings:

GPU , GPU 2: Running watt +x/-y watts

RTX 2060, 2060 Super: 126W +/-1 Watt
RTX 2070: 129W +4/-2 Watt
RTX 2070 Super, 2080: 144W +/-5 Watt
RTX 2080 Super: 149W +/-7 Watt
RTX 2080 Ti: 166W. +14/-12 Watt

I raise the value by x watts, if the ambient temperature gets closer to 85-90F.
I lower the value by y watts, if the ambient temperature gets closer to 55F.

Lowering the power, reduces heat. When heat goes lower, the driver will increase the boost frequency.
Together with a fine tuned overclock, you can get near to 95% of performance, at 60-75% of the power consumption. I’m not sure why Nvidia tunes for maximum performance, instead of highest efficiency on the RTX line, as these cards run very hot (inside a case), and consume a lot of power.

The performance penalty (~5-10%) is well worth the reduction in heat (20-40C lower temps) and power consumption (25-40% lower per card).

If you have an intermittent performance demand on your card, water cooling is offering a better solution.