Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a live log of all the processes run by the root user, so that I can just tail the file or something, I know there is /root/.bash_history but that is not updated until the session has ended.

Is there a way I can set it up so that commands are written live to the end of a file?

share|improve this question
it's called a keylogger – RobotHumans Apr 10 '12 at 3:44
Possible duplicate… – bodhi.zazen Apr 10 '12 at 5:01
up vote 1 down vote accepted

For commands run when logged in as root, no. However, if you require all users (and yourself) to execute with root privileges, via the sudo command, then yes. Details:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.