I would like to edit
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed to change its content from 800000 to 1600000.
I first try with emacs
$ sudo emacs -nw /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
In emacs I have changed the value to 1600000 in the file, and when I save the changes, the message buffer says:
Saving file /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed... Wrote /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
But after I exit emacs and read the file again, the value is still 800000
Then I try another way
$ sudo less /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
wherein I hit
vto invoke default editor which is nano, and then I change the value. After I exit nano and less, and check the file again, the file has been changed successfully.
I wonder why the first way doesn't work while the second does?
I am running Ubuntu 16.04 on a Thinkpad T400. Thanks.