LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-07-2011, 06:06 PM   #1
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 346

Rep: Reputation: 38
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

Last edited by thund3rstruck; 05-07-2011 at 06:06 PM. Reason: typos
 
Old 05-07-2011, 06:50 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,767

Rep: Reputation: 322Reputation: 322Reputation: 322Reputation: 322
@ 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.

Last edited by T3RM1NVT0R; 05-07-2011 at 07:05 PM.
 
1 members found this post helpful.
Old 05-07-2011, 07:10 PM   #3
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 346

Original Poster
Rep: Reputation: 38
Quote:
Originally Posted by T3RM1NVT0R View Post
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.
 
Old 05-07-2011, 07:23 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,767

Rep: Reputation: 322Reputation: 322Reputation: 322Reputation: 322
@ 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.
 
  


Reply

Tags
bashprofile, bashrc


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bash_history sassy2010 Linux - Newbie 8 09-25-2010 03:11 PM
.bash_history t3gah Linux - Software 2 05-05-2005 03:45 AM
bash_history linj Linux - Software 6 08-08-2003 10:13 AM
.bash_history gone togeno Linux - Security 3 06-30-2003 07:10 AM
.bash_history question iceman47 Linux - Security 4 06-06-2003 04:29 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration