8

Is there any way to save the commands typed and the outputs obtained in terminal under GRASS GIS to a text file? I have read that GRASS saves history for each mapset but I have no much idea about how to obtain that.

Although there is "Save Output" in "Command Console" in GRASS GIS Layer Manager, many times I have faced a situation when the saved output has only one line!

Chethan S.
  • 4,849
  • 2
  • 23
  • 39

1 Answers1

7

Three command history logs are available within each mapset.

Inside the hist directory, you will find command logs for each raster layer.

Within the sub-directories vector, you will find the command logs for each vector layer.

There is also .bash_history file in the main mapset directory for all commands logs you used during a GRASS session.

All of them are simple text files.

maning
  • 3,040
  • 1
  • 28
  • 29
  • They were really useful inputs. But I ran r.covar and the output obtained is not found on .bash_history. Is there any other directory where they get stored or do I have to export the output exclusively to a file. – Chethan S. Mar 10 '11 at 08:29
  • .bash_history is usually save when you exit/finish a GRASS session. – maning Mar 10 '11 at 08:33
  • I checked after exiting as well. But only exit is shown after my r.covar inputs. – Chethan S. Mar 10 '11 at 08:35
  • 1
    Do you mean to save the r.covar output or the command itself? To save the command output, try r.covar map=mapx > file.txt – maning Mar 10 '11 at 08:46
  • Alright, thank you. Its mainly to save the output but at times I have to look back into commands typed in previous sessions as well. – Chethan S. Mar 10 '11 at 08:57
  • .bash_history is not created in my customized version of i.aicorr(grass gis 6.4.4). is there a way to write it to text file for seeing the error log manually. – user28542 May 02 '16 at 04:53