I want to redirect the output of a linux command to a log_file. I am first echoing a command to trigger some logs, I want those logs to be stored in a file?
#echo "m" > /proc/sysrq-trigger >> log_file
using it without log_files gives following output:
#echo "m" > /proc/sysrq-trigger
[11474.069710] sysrq: SysRq : Show Memory
However with ">> log_file" m is stored in log_file.
I am expectig the output of the command "sysrq: SysRq : Show Memory" to be stored log_file
I have tried the pipe method as well but no success.