File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes query about histoy command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "query about histoy command" Watch "query about histoy command" New topic
Author

query about histoy command

dhoruboyina manjunath
Greenhorn

Joined: Jan 29, 2012
Posts: 1
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

Joined: May 14, 2008
Posts: 5812
    
    7

What history are you talking about? bash already stores command history, I think that the number of commands remembered is configurable.


JBoss In Action
Pradeep Kumar
Ranch Hand

Joined: Sep 08, 2006
Posts: 108
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.


Thanks and Regards, Pradeep Kumar
SCJP 1.6, SCWCD 5.0
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1502
    
    5

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.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
 
Consider Paul's rocket mass heater.
 
subject: query about histoy command
 
Similar Threads
Java RMI Test Cases
store the output of "find" command in a variable?
history command question
Allocate more memory for Heap
Return value from main