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!

1 Answer 1


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.

  • 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.
    Commented Mar 10, 2011 at 8:29
  • .bash_history is usually save when you exit/finish a GRASS session.
    – maning
    Commented Mar 10, 2011 at 8:33
  • I checked after exiting as well. But only exit is shown after my r.covar inputs.
    – Chethan S.
    Commented Mar 10, 2011 at 8: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
    Commented Mar 10, 2011 at 8: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.
    Commented Mar 10, 2011 at 8:57

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.