LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What Process Owns ~/.bash_history? (https://www.linuxquestions.org/questions/programming-9/what-process-owns-%7E-bash_history-879397/)

thund3rstruck 05-07-2011 06:06 PM

What Process Owns ~/.bash_history?
 
I'd like to gather some metrics about command line usage (which commands are most frequently executed, how many commands are being typed in by users, how much time is spend at the CLI, how many attempts at using a command are made before the user gets the right switches, etc, etc) for a group of users on a network.

The values I'm really after are: what commands are issued to the system and what time were they executed. From there I think I can create some baseline statistics.

I can easily aggregate & parse /home/*/.bash_history to get the commands but I'd like to know what time each command was run. Is there an alias or a config file where I can request the process owning the .bash_history to also echo/pipe/tee out to a separate file (along with the dates) after the entry in .bash_history is run?

Thanks

T3RM1NVT0R 05-07-2011 06:50 PM

@ Reply
 
Hi there,

I guess you are looking for this:

http://www.cyberciti.biz/faq/list-co...n-linuxserver/

http://www.cyberciti.biz/tips/howto-...ccounting.html

Make sure you start psacct before it starts capturing the info for you.

thund3rstruck 05-07-2011 07:10 PM

Quote:

Originally Posted by T3RM1NVT0R (Post 4349576)
Hi there,

I guess you are looking for this:

http://www.cyberciti.biz/faq/list-co...n-linuxserver/

http://www.cyberciti.biz/tips/howto-...ccounting.html

Make sure you start psacct before it starts capturing the info for you.

Thanks! That looks great. I was hoping to roll my own solution since certifying 3rd party binaries is not easy to do in this customer's environment but I'll certainly investigate these programs and see if they are open source with a non-restrictive license towards commercial use.

T3RM1NVT0R 05-07-2011 07:23 PM

@ Reply
 
Well it is there on RHEL6 I just checked using rpm -qa

Also checked on RHEL5 and it is there also and my both RHEL5 and RHEL6 (beta) are not registered ones.


All times are GMT -5. The time now is 12:24 AM.