I'm getting the Gps values after running the following commands in Raspberry Pi .
sudo gpsd /dev/ttyACM0 -F /var/run/gpsd.socket gpsmon
How can I copy or write the gps data displayed on terminal to a text file?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
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.