Super User is a question and answer site for computer enthusiasts and power users. 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 see the commands that I entered in su mode? Similar to the ~/.bash_history? Where would this be located?

share|improve this question
up vote 2 down vote accepted

actually it is in .bash_history. But when you su, you switch user, so you have to check .bash_history as the user you su'd to. When you su again, and type history, it will give you only the history from that user.

Eg. you changed to root, so using history as root again, or checking the root-homefolder (default is /root) for .bash_history will give you all previous commands.

share|improve this answer

In Debian you can define the variable SULOG_FILE in file /etc/login.defs as the log file for su activity.

You can test the contents of you login.defs, also man su can tell you if supported.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .