- Windows/Linux /MacOS 如果是自己在终端执行命令, 是有 历史记录的.
- 有些 Python 写的程序, 调用了命令来执行系统命令, 例如 dir/ls , 那么有没有地方能够查询到这些的历史记录?
- 程序本身没有进行这方面的记录日志
例如: Python 在 Windows 中以下代码
import os
os.system("echo Hello from the other side!")
import subprocess
list_files = subprocess.run(["ls", "-l"])
print("The exit code was: %d" % list_files.returncode)
import subprocess
list_dir = subprocess.Popen(["ls", "-l"])
list_dir.wait()