skip to main content

SAP NetWeaver Newbie

How to Timestamp the History of Commands Used in AIX

Until AIX 5.3, one could only store what commands were run by a user. Having information on what command was run by a user ID is useful, but it is not always sufficient to conclude if that command caused a certain effect at a certain time. One needs to know WHEN a command was run as well.

The command history can be time stamped from AIX 5.3 onward, by setting the following to a user's environment:
EXTENDED_HISTORY=ON
HISTSIZE=5000

You have to make sure that a HISTSIZE (5000 shown above is an example, you can set it to a value based on you needs) is also defined when EXTENDED_HISTORY is set.

Now you could set these environment variable on each user's logon script or you can push it to all the users by adding "EXTENDED_HISTORY=ON" (without quotes) to /etc/environment and "export HISTSIZE=5000" to /etc/profile.

Remember that you won't be able to see the time stamps using history command. You can see them in .sh_history file in home directory of the user.You won't be able to see the time stamps using history command, you can see them in .sh_history file in home directory of the user.

1 comment:

  1. In addition to this great advice, you'll also want to change /etc/profile and /etc/csh.cshrc to redefine the history alias from its default of "fc -l" to "fc -t"

    ReplyDelete

Email Subscription

Get every new post into your inbox by subscribing us.

Want a reason to subscribe?
1. This sitemap might convince you to subscribe.
2. We do not misuse email IDs. We respect privacy.

© 2008 - 2017 sapnwnewbie. All rights reserved.