Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query about histoy command

 
dhoruboyina manjunath
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir,
suppose we like to store history of user in file. is there any possibility to do this using shell script and also shell script to store multiple uers history at a time using shell script
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What history are you talking about? bash already stores command history, I think that the number of commands remembered is configurable.
 
Pradeep Kumar
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. The history of commands executed for the users will be stored in the .bash_history file inside the home directory. Also the number of commands to be stored in history can be configured using the H!ISTSIZE property. Some additional useful commands can be found on http://www.unixonthego.com/history-command-with-unix/ website.
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello dhoruboyina manjunath,

Welcome to CodeRanch!

As above posts mention, command history is already store in shell's history file (e.g. ~/.bash_history in case of bash).

Also, since this file is in home directory, there will be separate history file per user.

I hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic