As with work, it's important to leave a work trail. Even in my personal environment, I wanted to keep a work log so that I could find the jammed place later. Due to my personality, the method of deciding the name of each log is troublesome and does not last long. I made a script so that I can get the work log by typing a fixed command.
The command is described in **. Bashrc **. This time I entered it with ** vi **. The command to get the work log is ** outputlog **. The name of the log is in the form "year / month / day_hour / minute / second.log".
$ vi ~/.bashrc
alias outputlog='script /home/pi/Desktop/scriptlogs/$(date +%Y%m%d_%H%M%S).log'
That's all. You can get the log by executing ** outputlog ** where you want to get the log.
There is no problem on the terminal, but when I output it to the log, the characters are garbled. I tried some, but it didn't work. I would like to know if there is a good way to solve it.