I am trying to follow another user's shell commands in realtime. I would like to have a shell window open and see exactly what they are keying in as they work (no, its not for snooping but for educational purposes). I don't want to use something like VNC.
Now I could run
tail -f ~[username]/.bash_history
but the .bash_history is cached and isn't written until the end of the session.
So what should I do? Please presume that I have read access to the other user's home directory and thus am actually ssh'd to the same machine as the one on which they are working. No, I don't need to see the keys being pressed - just the complete lines as they are executed.
Lets complicate this a bit further... What happens if they run
What do I do to follow that?