linux - Capture executed commands from programs -


is there way capture commands executed gui programs ? or simple bash scripts ? "history" command bash available on whole system.

a shell (e.g. bash) has -x option , can see commands executed particular script. run sh -x <your_script , see output. can temporarily turn on/off logging issuing set +x, set -x inside script.

regarding gui programs, answer depends on needs, kind of activity you'd log. can use strace suggested in comments, , filter out exec* calls. assume else since activities of gui program performed w/o executing external programs.


Comments