I'm getting the Gps values after running the following commands in Raspberry Pi .

sudo gpsd /dev/ttyACM0 -F /var/run/gpsd.socket


How can I copy or write the gps data displayed on terminal to a text file?


1 Answer 1


Pipe the output from gpsmon into a file. (if the file exists already and is writable it will be wiped)

gpsmon > gpsmon.txt

Pipe the output from gpsmon to append to an existing file (provided file permissions allow write access)

gpsmon >> gpsmon.txt

Use 'tee' command to display on the terminal and pipe to a file at the same time. (same caveats on permissions occur - will overwrite existing file).

gpsmon | tee gpsmon.txt

Use 'tee' to display on the terminal and append to a file.

gpsmon | tee -a gpsmon.txt

All examples where 'gpsmon.txt' is the name of the file where your output will be saved. If gpsmon.txt doesn't exist it will be created.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.