> ## Content Index
> Fetch the complete content index at: https://kudithipudi.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# HOW TO : Log all commands issued in shell to syslog
- URL: https://kudithipudi.org/how-to-log-all-commands-issued-in-shell-to-syslog/
- Published: 2012-04-05T23:41:07.000Z
- Updated: 2012-04-05T23:41:07.000Z
- Description: Inspired from this blog post by Vaidas Jablonskis. This tip has been tested on Redhat and Centos distributions. If you ever wanted to log all the...
- Author: admin
- Tags: HOWTO, Linux, Uncategorized, #wp, #wp-post, #Import 2026-08-23 02:32

Inspired from [this](http://jablonskis.org/2011/howto-log-bash-history-to-syslog/?ref=kudithipudi.org) blog post by [Vaidas Jablonskis](https://plus.google.com/112500968398778336156?ref=kudithipudi.org). This tip has been tested on Redhat and Centos distributions.

If you ever wanted to log all the commands issued by users on a server, you can edit the default profile configuration to enable this

- Log out and log back into your session
- Now all your commands are logged in the default log file (/var/log/messages)

Edit /etc/bashrc file and add the following at the end of the file

```
PROMPT_COMMAND=’history -a >(logger -t "$USER[$$] $SSH_CONNECTION")’
```