File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

query about histoy command

dhoruboyina manjunath

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

Joined: May 14, 2008
Posts: 5852

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 website.

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

Joined: Dec 08, 2010
Posts: 1545

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.

Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
I agree. Here's the link:
subject: query about histoy command
jQuery in Action, 3rd edition