Using the command script
Enter script Xxx.log at the command line, generate the Xxx.log file in the current directory, and then the output from the command line will be saved to the Xxx.log file, and when you want to end the save, enter the Exit command at the end of the command line to save.
At this point the Xxx.log file is saved in the information just generated, you can cat view the file for appropriate.
If you are unable to use the script command in the Arm-linux system, it is possible that your file system does not have the configuration to enable the command when it is created. The workaround is to recompile your file system, make Menuconfig, and select the option. Or to find a bin file for the command, the directory where the file is located is exported to the environment variable in the system.
This article is from the "Whylinux" blog, make sure to keep this source http://whylinux.blog.51cto.com/10900429/1950527
method to save command line output information to log (valid under Ubunut and Arm-linux)