How to save the console in R studio (input+output)

Hi I am new (with Rstudio too)!

I was wondering if there is any function in Rstudio to save in a txt file both the input and output of the console. I want to save everything.

In R you can save it in File->save to file, but I haven't found any option such that in Rstudio.

Thank you for your help.