Saving Data In a Text File


Iconnect my BeagleBone to my windows laptop and i run putty to my BeagleBone cmd which is


after which i retrieve the sensor value using the code which is :

for sensor in /sys/bus/i2c/devices/i2c-1//_input; do echo -n "$(basename $sensor): "; cat $sensor; done

the value I retrieve is

lux1_input: 121
humidity1_input: 58476
temp1_input: 25297
pressure0_input: 99590
temp0_input: 250

How do I save this in a text file on my windows laptop instead?


This is a Unix/linux question, not a BBB question. Use redirection to send results to a file.

echo “Hello”
(prints Hello on the console)
echo “Hello” > datafile.txt
(saves Hello to datafile.txt instead of the console)


I think your answer is not precise. This is not a Linux question but a Windows/Putty question.

Possible answers could be:

  1. use copy/paste from the putty window to the file you like
  2. use putty log option.


There are tens, if not hundreds of ways to go about this.