Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-01-2007, 04:07 AM   #1
LQ Newbie
Registered: Sep 2003
Location: London
Distribution: RedHat, SuSE
Posts: 9

Rep: Reputation: 0
How do I follow another user's shell commands?

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

sudo su
What do I do to follow that?


Old 06-01-2007, 04:11 AM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Have a look at script. Script will allow you to tail the input
(and results) of such activity.

Old 06-01-2007, 08:00 AM   #3
avirup dasgupta
Registered: Aug 2003
Distribution: Redhat , Fedora Core4, DSL,Solaris
Posts: 49

Rep: Reputation: 15
I heard about a product named PowerBroker which among other things does
'Comprehensive "keystroke logs" capture'
Old 06-01-2007, 08:35 AM   #4
LQ Newbie
Registered: Sep 2003
Location: London
Distribution: RedHat, SuSE
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks but Tink's reply was spot on. Script is in use already!

Old 06-01-2007, 09:26 AM   #5
Registered: Nov 2005
Location: Ontario, Canada
Distribution: Ubuntu
Posts: 114

Rep: Reputation: 15
Screen is another option, the "-x" option will permit multiple displays of the same session, I've never used screen in this manner, but screen is a terrific tool in many other ways.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
more shell commands mf5160 Linux - Software 3 03-14-2007 02:41 PM
about shell commands nesta Linux - Newbie 3 12-12-2006 06:40 PM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 03:34 PM
where are a user's commands saved? learnfast Linux - Newbie 2 03-10-2005 09:17 AM
changing user's previlegdes for commands nchauhan Linux - Newbie 5 06-14-2003 10:32 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration