Is there a way to see the commands that I entered in su mode? Similar to the ~/.bash_history? Where would this be located?

2 Answers 2


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.


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.

You must log in to answer this question.

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