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

Is there a way to monitor commands that are executed on an ubuntu system? basically i am looking for something like a key logger but only for commands executed.

share|improve this question
Are you looking for your commands or for commands from all users? Or even only for your commands for a specific session (e.g. see script)? If you are looking on spying on other users, then please realise that I used the term spying. – Hennes Sep 23 '13 at 16:28

I am thinking that you could look into the BASH history file? From the BASH MAN page "On startup, the history is initialized from the file named by the variable HISTFILE (default ~/.bash_history)."

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.