-sharp
python xxxx.py|tee 1.log
-sharp
python xxxx.py|tee -a 1.log
if there is no tee command on the system, install the command
-sharp Debian
apt -y install coreutils
-sharp Redhat
yum -y install coreutils
you can execute python xxxx.py > 1.log &
so that the process takes place in the background, which you can see through jobs. The log is written in 1.log
. Then if you want to view the log in real time, you can use tail-f 1.log
.
Previous: Does thymeleaf really work?