I'm completely new to SSH and I'm trying different things. I wanted to write my custom commands output to a log file.
Here is my command:
hostname:~$ sudo checktemp grep
/dev/sda: ST3320820AS: 38°C
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +45.0°C (high = +78.0°C, crit = +100.0°C)
Core 1: +45.0°C (high = +78.0°C, crit = +100.0°C)
radeon-pci-0100
Adapter: PCI adapter
temp1: +59.0°C
I want to write to file the following:
ST3320820AS: 38°C
Core 0: +45.0°C
Core 1: +45.0°C
temp1: +59.0°C
I looked up grep command but no success.
Additionaly I would like to now how to set the log file destination and wrote settings (write new line etc.).
I would like the log file to look like below:
ST3320820AS; Core 0; Core 1; temp1; date; time
38°C; +45.0°C; +45.0°C; +59.0°C; yyyy-mm-dd; hh:mm:ss
Thanks for your help.